diff --git a/examples/06-bump/bump.cpp b/examples/06-bump/bump.cpp index ef880fff..d78402dd 100644 --- a/examples/06-bump/bump.cpp +++ b/examples/06-bump/bump.cpp @@ -148,8 +148,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::IndexBufferHandle ibh = bgfx::createIndexBuffer(bgfx::makeRef(s_cubeIndices, sizeof(s_cubeIndices) ) ); // Create texture sampler uniforms. - bgfx::UniformHandle u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Int1); - bgfx::UniformHandle u_texNormal = bgfx::createUniform("u_texNormal", bgfx::UniformType::Int1); + bgfx::UniformHandle s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); + bgfx::UniformHandle s_texNormal = bgfx::createUniform("s_texNormal", bgfx::UniformType::Int1); uint16_t numLights = 4; bgfx::UniformHandle u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4, numLights); @@ -280,8 +280,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setIndexBuffer(ibh); // Bind textures. - bgfx::setTexture(0, u_texColor, textureColor); - bgfx::setTexture(1, u_texNormal, textureNormal); + bgfx::setTexture(0, s_texColor, textureColor); + bgfx::setTexture(1, s_texNormal, textureNormal); // Set render states. bgfx::setState(0 @@ -320,8 +320,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::setIndexBuffer(ibh); // Bind textures. - bgfx::setTexture(0, u_texColor, textureColor); - bgfx::setTexture(1, u_texNormal, textureNormal); + bgfx::setTexture(0, s_texColor, textureColor); + bgfx::setTexture(1, s_texNormal, textureNormal); // Set render states. bgfx::setState(0 @@ -349,8 +349,8 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyProgram(program); bgfx::destroyTexture(textureColor); bgfx::destroyTexture(textureNormal); - bgfx::destroyUniform(u_texColor); - bgfx::destroyUniform(u_texNormal); + bgfx::destroyUniform(s_texColor); + bgfx::destroyUniform(s_texNormal); bgfx::destroyUniform(u_lightPosRadius); bgfx::destroyUniform(u_lightRgbInnerR); diff --git a/examples/06-bump/fs_bump.sc b/examples/06-bump/fs_bump.sc index 59f3a0f9..f5806ebe 100644 --- a/examples/06-bump/fs_bump.sc +++ b/examples/06-bump/fs_bump.sc @@ -7,8 +7,8 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0 // in... #include "../common/common.sh" -SAMPLER2D(u_texColor, 0); -SAMPLER2D(u_texNormal, 1); +SAMPLER2D(s_texColor, 0); +SAMPLER2D(s_texNormal, 1); uniform vec4 u_lightPosRadius[4]; uniform vec4 u_lightRgbInnerR[4]; @@ -61,7 +61,7 @@ void main() ); vec3 normal; - normal.xy = texture2D(u_texNormal, v_texcoord0).xy * 2.0 - 1.0; + normal.xy = texture2D(s_texNormal, v_texcoord0).xy * 2.0 - 1.0; normal.z = sqrt(1.0 - dot(normal.xy, normal.xy) ); vec3 view = -normalize(v_view); @@ -71,7 +71,7 @@ void main() lightColor += calcLight(2, tbn, v_wpos, normal, view); lightColor += calcLight(3, tbn, v_wpos, normal, view); - vec4 color = toLinear(texture2D(u_texColor, v_texcoord0) ); + vec4 color = toLinear(texture2D(s_texColor, v_texcoord0) ); gl_FragColor.xyz = max(vec3_splat(0.05), lightColor.xyz)*color.xyz; gl_FragColor.w = 1.0; diff --git a/examples/runtime/shaders/dx9/fs_bump.bin b/examples/runtime/shaders/dx9/fs_bump.bin index 90aba9ef..9ef67fd4 100644 Binary files a/examples/runtime/shaders/dx9/fs_bump.bin and b/examples/runtime/shaders/dx9/fs_bump.bin differ diff --git a/examples/runtime/shaders/gles/fs_bump.bin b/examples/runtime/shaders/gles/fs_bump.bin index e2ff147b..c0d14633 100644 Binary files a/examples/runtime/shaders/gles/fs_bump.bin and b/examples/runtime/shaders/gles/fs_bump.bin differ diff --git a/examples/runtime/shaders/glsl/fs_bump.bin b/examples/runtime/shaders/glsl/fs_bump.bin index 9321e5a0..d8f1a5d7 100644 Binary files a/examples/runtime/shaders/glsl/fs_bump.bin and b/examples/runtime/shaders/glsl/fs_bump.bin differ