diff --git a/examples/13-stencil/fs_stencil_color_texture.sc b/examples/13-stencil/fs_stencil_color_texture.sc index eea20d8f..fafbf3de 100644 --- a/examples/13-stencil/fs_stencil_color_texture.sc +++ b/examples/13-stencil/fs_stencil_color_texture.sc @@ -7,16 +7,16 @@ $input v_texcoord0 #include "../common/common.sh" uniform vec4 u_color; -SAMPLER2D(u_texColor, 0); +SAMPLER2D(s_texColor, 0); void main() { - vec4 tcolor = toLinear(texture2D(u_texColor, v_texcoord0)); + vec4 color = toLinear(texture2D(s_texColor, v_texcoord0) ); - if (tcolor.x < 0.1) //OK for now. + if (color.x < 0.1) { discard; } - gl_FragColor = toGamma(tcolor + u_color); + gl_FragColor = toGamma(color + u_color); } diff --git a/examples/13-stencil/fs_stencil_texture.sc b/examples/13-stencil/fs_stencil_texture.sc index 42c27814..0f33138b 100644 --- a/examples/13-stencil/fs_stencil_texture.sc +++ b/examples/13-stencil/fs_stencil_texture.sc @@ -6,9 +6,9 @@ $input v_texcoord0 */ #include "../common/common.sh" -SAMPLER2D(u_texColor, 0); +SAMPLER2D(s_texColor, 0); void main() { - gl_FragColor = texture2D(u_texColor, v_texcoord0); + gl_FragColor = texture2D(s_texColor, v_texcoord0); } diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index 1493c823..4be3ef78 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -149,7 +149,7 @@ static const uint16_t s_planeIndices[] = static bool s_flipV = false; static uint32_t s_viewMask = 0; static uint32_t s_clearMask = 0; -static bgfx::UniformHandle u_texColor; +static bgfx::UniformHandle s_texColor; inline void mtxProj(float* _result, float _fovy, float _aspect, float _near, float _far) { @@ -809,7 +809,7 @@ struct Mesh // Set texture if (bgfx::invalidHandle != _texture.idx) { - bgfx::setTexture(0, u_texColor, _texture); + bgfx::setTexture(0, s_texColor, _texture); } // Apply render state @@ -864,7 +864,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) s_uniforms.init(); s_uniforms.submitConstUniforms(); - u_texColor = bgfx::createUniform("u_texColor", bgfx::UniformType::Int1); + s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); bgfx::ProgramHandle programTextureLightning = loadProgram("vs_stencil_texture_lightning", "fs_stencil_texture_lightning"); bgfx::ProgramHandle programColorLightning = loadProgram("vs_stencil_color_lightning", "fs_stencil_color_lightning" ); @@ -1397,7 +1397,7 @@ int _main_(int /*_argc*/, char** /*_argv*/) bgfx::destroyProgram(programColorBlack); bgfx::destroyProgram(programTexture); - bgfx::destroyUniform(u_texColor); + bgfx::destroyUniform(s_texColor); s_uniforms.destroy(); diff --git a/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin b/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin index 54c09238..907eea12 100644 Binary files a/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin and b/examples/runtime/shaders/dx9/fs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/dx9/fs_stencil_texture.bin b/examples/runtime/shaders/dx9/fs_stencil_texture.bin index 9d269aaf..1334b0e8 100644 Binary files a/examples/runtime/shaders/dx9/fs_stencil_texture.bin and b/examples/runtime/shaders/dx9/fs_stencil_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_color_texture.bin b/examples/runtime/shaders/gles/fs_stencil_color_texture.bin index 885640dd..d843710a 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_color_texture.bin and b/examples/runtime/shaders/gles/fs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/gles/fs_stencil_texture.bin b/examples/runtime/shaders/gles/fs_stencil_texture.bin index f021c850..18195420 100644 Binary files a/examples/runtime/shaders/gles/fs_stencil_texture.bin and b/examples/runtime/shaders/gles/fs_stencil_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin b/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin index 08ec2bbf..16e982ef 100644 Binary files a/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin and b/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin differ diff --git a/examples/runtime/shaders/glsl/fs_stencil_texture.bin b/examples/runtime/shaders/glsl/fs_stencil_texture.bin index fafb0e90..d9bf2d2c 100644 Binary files a/examples/runtime/shaders/glsl/fs_stencil_texture.bin and b/examples/runtime/shaders/glsl/fs_stencil_texture.bin differ