From 0283c83c0a7f3a71adc8743d0f3db1a834532a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 19 Jun 2015 21:47:20 -0700 Subject: [PATCH] Cleanup. --- examples/13-stencil/fs_stencil_color_texture.sc | 8 ++++---- examples/13-stencil/fs_stencil_texture.sc | 4 ++-- examples/13-stencil/stencil.cpp | 8 ++++---- .../shaders/dx9/fs_stencil_color_texture.bin | Bin 555 -> 555 bytes .../runtime/shaders/dx9/fs_stencil_texture.bin | Bin 201 -> 201 bytes .../shaders/gles/fs_stencil_color_texture.bin | Bin 687 -> 687 bytes .../runtime/shaders/gles/fs_stencil_texture.bin | Bin 211 -> 211 bytes .../shaders/glsl/fs_stencil_color_texture.bin | Bin 602 -> 602 bytes .../runtime/shaders/glsl/fs_stencil_texture.bin | Bin 160 -> 160 bytes 9 files changed, 10 insertions(+), 10 deletions(-) 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 54c092386f71986edccc006709ce70b517b1e703..907eea12f741d0bfc0779baa8d0f2f5e54c14961 100644 GIT binary patch delta 90 zcmZ3@vYKUrn?ExH0|O%i6GH%y27v@1W&&bHAkF|{5Gal>Nv&|s&&e-hSk1z~1C#?n V2q=wD21_t9FayO{Hcp+!2mmBF4PF2M delta 48 vcmZ3@vYKUrn=BIp0|O%v`v5Tr!~iif5Hm6`F=R}vmuD=Um@U0=UN0j6po9nn diff --git a/examples/runtime/shaders/dx9/fs_stencil_texture.bin b/examples/runtime/shaders/dx9/fs_stencil_texture.bin index 9d269aaf1e8a54815266423553dc36ff6dc99ad9..1334b0e8a26ee3519af01704dbe6f441be6cf90a 100644 GIT binary patch delta 11 ScmX@fc#?5~2V?O>&jtV*2Lw9+ delta 11 ScmX@fc#?5~2V?0(&jtV*4+K2` diff --git a/examples/runtime/shaders/gles/fs_stencil_color_texture.bin b/examples/runtime/shaders/gles/fs_stencil_color_texture.bin index 885640dda0a9bfff823f796317c1c21efd1c2ec3..d843710a8b0c4a0e541e9aed02fd46d8fd2106ae 100644 GIT binary patch delta 22 ccmZ3_x}J4{BxCVJsYD=ABJxpATiql0DhMUegFUf diff --git a/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin b/examples/runtime/shaders/glsl/fs_stencil_color_texture.bin index 08ec2bbf4717fc2201cc9469a88821b2b5d786cd..16e982ef81c4cc3e256f34e24e86656a50052753 100644 GIT binary patch delta 22 ccmcb`a*JhxBxCVJsZbzM;LKROamzAB09&;P5&!@I delta 22 ccmcb`a*JhxBxC7BsZbzM;LKRMamzAB09)}07ytkO diff --git a/examples/runtime/shaders/glsl/fs_stencil_texture.bin b/examples/runtime/shaders/glsl/fs_stencil_texture.bin index fafb0e9002a64fb6d47b066cdda745f28f092a5d..d9bf2d2c4a0c8b567f67669d4544f0167049b66c 100644 GIT binary patch delta 56 zcmZ3$xPXzzE!cx4U(U{kk%6mtB9A>|@kAdpx#IYe)C%YPoctmkg)$I3IX}NB#X!@V JtCow40RX;O5EK9a delta 56 zcmZ3$xPXzzE!cx4U(U{kk%6mpB9A>|=|mqhxzhNO)C%YPoctmkg)$I3IX}NB#X!@V JtCow40RX=$5E=jg