From 46b573db52eeddfc95578d52fba134a11275cecf Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Fri, 1 Nov 2013 20:49:36 +0000 Subject: [PATCH] Fixing some implicit casts. These must be ignored in GLSL 1.5 but with older GLSL spec'ed I was getting implicit cast errors. I believe these are harmless if not needed but I'm not sure if there are hidden ramifications. This looks more correct to my eyes. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10866 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core-data/Common/ShaderLib/MultiSample.glsllib | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/core-data/Common/ShaderLib/MultiSample.glsllib b/engine/src/core-data/Common/ShaderLib/MultiSample.glsllib index 0e5355cea..f49612e31 100644 --- a/engine/src/core-data/Common/ShaderLib/MultiSample.glsllib +++ b/engine/src/core-data/Common/ShaderLib/MultiSample.glsllib @@ -18,16 +18,16 @@ uniform int m_NumSamplesDepth; // NOTE: Only define multisample functions if multisample is available and is being used! #if defined(GL_ARB_texture_multisample) && (defined(RESOLVE_MS) || defined(RESOLVE_DEPTH_MS)) vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){ - ivec2 iTexC = ivec2(texC * textureSize(tex)); + ivec2 iTexC = ivec2(texC * vec2(textureSize(tex))); vec4 color = vec4(0.0); for (int i = 0; i < numSamples; i++){ color += texelFetch(tex, iTexC, i); } - return color / numSamples; + return color / float(numSamples); } vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){ - ivec2 iTexC = ivec2(texC * textureSize(tex)); + ivec2 iTexC = ivec2(texC * vec2(textureSize(tex))); return texelFetch(tex, iTexC, sample); } @@ -36,7 +36,7 @@ vec4 getColor(in sampler2DMS tex, in vec2 texC){ } vec4 getColorSingle(in sampler2DMS tex, in vec2 texC){ - ivec2 iTexC = ivec2(texC * textureSize(tex)); + ivec2 iTexC = ivec2(texC * vec2(textureSize(tex))); return texelFetch(tex, iTexC, 0); }