Browse Source

Shaders: test Phong normal texture multi-bind as well.

pull/364/head
Vladimír Vondruš 7 years ago
parent
commit
c60ef6039f
  1. 16
      src/Magnum/Shaders/Test/PhongGLTest.cpp

16
src/Magnum/Shaders/Test/PhongGLTest.cpp

@ -165,11 +165,13 @@ constexpr struct {
/* MSVC 2015 doesn't like constexpr here due to the angles */ /* MSVC 2015 doesn't like constexpr here due to the angles */
const struct { const struct {
const char* name; const char* name;
bool multiBind;
Deg rotation; Deg rotation;
} RenderTexturedNormalData[]{ } RenderTexturedNormalData[]{
{"", {}}, {"", false, {}},
{"rotated 90°", 90.0_degf}, {"multi bind", true, {}},
{"rotated -90°", -90.0_degf} {"rotated 90°", false, 90.0_degf},
{"rotated -90°", false, -90.0_degf}
}; };
const struct { const struct {
@ -764,8 +766,12 @@ void PhongGLTest::renderTexturedNormal() {
Matrix4::rotationY(-15.0_degf)* Matrix4::rotationY(-15.0_degf)*
Matrix4::rotationX(15.0_degf)).rotationScaling()) Matrix4::rotationX(15.0_degf)).rotationScaling())
.setProjectionMatrix(Matrix4::perspectiveProjection(60.0_degf, 1.0f, 0.1f, 10.0f)) .setProjectionMatrix(Matrix4::perspectiveProjection(60.0_degf, 1.0f, 0.1f, 10.0f))
.setDiffuseColor(0x999999_rgbf) .setDiffuseColor(0x999999_rgbf);
.bindNormalTexture(normal);
if(data.multiBind)
shader.bindTextures(nullptr, nullptr, nullptr, &normal);
else
shader.bindNormalTexture(normal);
plane.draw(shader); plane.draw(shader);

Loading…
Cancel
Save