|
|
|
@ -232,9 +232,8 @@ mesh.draw(shader); |
|
|
|
/* [MeshVisualizer-usage-geom2] */ |
|
|
|
/* [MeshVisualizer-usage-geom2] */ |
|
|
|
|
|
|
|
|
|
|
|
/* [MeshVisualizer-usage-no-geom-old1] */ |
|
|
|
/* [MeshVisualizer-usage-no-geom-old1] */ |
|
|
|
constexpr std::size_t vertexCount = Containers::arraySize(data); |
|
|
|
Containers::Array<Float> vertexIndex{Containers::arraySize(data)}; |
|
|
|
Float vertexIndex[vertexCount]; |
|
|
|
std::iota(vertexIndex.begin(), vertexIndex.end(), 0.0f); |
|
|
|
std::iota(vertexIndex, vertexIndex + vertexCount, 0.0f); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GL::Buffer vertexIndices; |
|
|
|
GL::Buffer vertexIndices; |
|
|
|
vertexIndices.setData(vertexIndex, GL::BufferUsage::StaticDraw); |
|
|
|
vertexIndices.setData(vertexIndex, GL::BufferUsage::StaticDraw); |
|
|
|
@ -353,13 +352,13 @@ mesh.draw(shader); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
GL::Texture2D ambientAlphaTexture, diffuseAlphaTexture; |
|
|
|
GL::Texture2D diffuseAlphaTexture; |
|
|
|
Color3 diffuseRgb, specularRgb; |
|
|
|
Color3 diffuseRgb, specularRgb; |
|
|
|
/* [Phong-usage-alpha] */ |
|
|
|
/* [Phong-usage-alpha] */ |
|
|
|
Shaders::Phong shader{Shaders::Phong::Flag::AmbientTexture| |
|
|
|
Shaders::Phong shader{Shaders::Phong::Flag::AmbientTexture| |
|
|
|
Shaders::Phong::Flag::DiffuseTexture}; |
|
|
|
Shaders::Phong::Flag::DiffuseTexture}; |
|
|
|
shader.bindTextures(&ambientAlphaTexture, &diffuseAlphaTexture, nullptr) |
|
|
|
shader.bindTextures(&diffuseAlphaTexture, &diffuseAlphaTexture, nullptr) |
|
|
|
.setAmbientColor(0x000000ff_rgbf) |
|
|
|
.setAmbientColor(0x000000ff_rgbaf) |
|
|
|
.setDiffuseColor(Color4{diffuseRgb, 0.0f}) |
|
|
|
.setDiffuseColor(Color4{diffuseRgb, 0.0f}) |
|
|
|
.setSpecularColor(Color4{specularRgb, 0.0f}); |
|
|
|
.setSpecularColor(Color4{specularRgb, 0.0f}); |
|
|
|
/* [Phong-usage-alpha] */ |
|
|
|
/* [Phong-usage-alpha] */ |
|
|
|
|