* Fixed syntax errors and crashes with shadow processor and filters

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7831 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 08e5d1a68f
commit f8df2f00cc
  1. 5
      engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM15.frag
  2. 34
      engine/src/core-data/Common/ShaderLib/MultiSample.glsllib
  3. 3
      engine/src/core/com/jme3/post/FilterPostProcessor.java

@ -1,4 +1,5 @@
#extension GL_ARB_texture_gather : enable
// Because gpu_shader5 is actually where those
// gather functions are declared to work on shadowmaps
#extension GL_ARB_gpu_shader5 : enable
#ifdef HARDWARE_SHADOWS
@ -82,7 +83,7 @@ float Shadow_DoBilinear_2x2(in SHADOWMAP tex, in vec4 projCoord){
return 1.0;
ivec2 texSize = textureSize(tex, 0);
#ifdef GL_ARB_texture_gather
#ifdef GL_ARB_gpu_shader5
vec4 coord = vec4(projCoord.xyz / projCoord.w,0.0);
vec4 gather = SHADOWGATHER(tex, coord);
#else

@ -1,4 +1,5 @@
#extension GL_ARB_texture_multisample : enable
uniform int m_NumSamples;
uniform int m_NumSamplesDepth;
@ -14,6 +15,8 @@ uniform int m_NumSamplesDepth;
#define DEPTHTEXTURE sampler2D
#endif
// NOTE: Only define multisample functions if multisample is being used!
#ifdef GL_ARB_texture_multisample
vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){
ivec2 iTexC = ivec2(texC * textureSize(tex));
vec4 color = vec4(0.0);
@ -23,36 +26,37 @@ vec4 textureFetch(in sampler2DMS tex,in vec2 texC, in int numSamples){
return color / numSamples;
}
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){
return texture2D(tex,texC);
}
vec4 fetchTextureSample(in sampler2DMS tex,in vec2 texC,in int sample){
ivec2 iTexC = ivec2(texC * textureSize(tex));
return texelFetch(tex, iTexC, sample);
}
vec4 getColor(in sampler2D tex, in vec2 texC){
return texture2D(tex,texC);
}
vec4 getColor(in sampler2DMS tex, in vec2 texC){
return textureFetch(tex, texC, m_NumSamples);
}
vec4 getColorSingle(in sampler2D tex, in vec2 texC){
return texture2D(tex, texC);
}
vec4 getColorSingle(in sampler2DMS tex, in vec2 texC){
ivec2 iTexC = ivec2(texC * textureSize(tex));
return texelFetch(tex, iTexC, 0);
}
vec4 getDepth(in sampler2D tex,in vec2 texC){
vec4 getDepth(in sampler2DMS tex,in vec2 texC){
return textureFetch(tex,texC,m_NumSamplesDepth);
}
#endif
vec4 fetchTextureSample(in sampler2D tex,in vec2 texC,in int sample){
return texture2D(tex,texC);
}
vec4 getDepth(in sampler2DMS tex,in vec2 texC){
return textureFetch(tex,texC,m_NumSamplesDepth);
vec4 getColor(in sampler2D tex, in vec2 texC){
return texture2D(tex,texC);
}
vec4 getColorSingle(in sampler2D tex, in vec2 texC){
return texture2D(tex, texC);
}
vec4 getDepth(in sampler2D tex,in vec2 texC){
return texture2D(tex,texC);
}

@ -40,7 +40,6 @@ import com.jme3.export.InputCapsule;
import com.jme3.export.OutputCapsule;
import com.jme3.export.Savable;
import com.jme3.material.Material;
import com.jme3.material.RenderState;
import com.jme3.renderer.Camera;
import com.jme3.renderer.Caps;
import com.jme3.renderer.RenderManager;
@ -140,7 +139,6 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
Camera cam = vp.getCamera();
//save view port diensions
left = cam.getViewPortLeft();
right = cam.getViewPortRight();
@ -150,7 +148,6 @@ public class FilterPostProcessor implements SceneProcessor, Savable {
originalHeight = cam.getHeight();
//first call to reshape
reshape(vp, cam.getWidth(), cam.getHeight());
}
/**

Loading…
Cancel
Save