Fixed typo in FXAA filter
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8087 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
5f0bfd8c2e
commit
367c9c3799
@ -2,7 +2,7 @@ MaterialDef FXAA {
|
||||
MaterialParameters {
|
||||
Int NumSamples
|
||||
Texture2D Texture
|
||||
Float SubPixelShif
|
||||
Float SubPixelShift
|
||||
Float VxOffset
|
||||
Float SpanMax
|
||||
Float ReduceMul
|
||||
|
@ -3,7 +3,7 @@ uniform vec2 g_Resolution;
|
||||
attribute vec4 inPosition;
|
||||
attribute vec2 inTexCoord;
|
||||
varying vec2 texCoord;
|
||||
uniform float m_SubPixelShif;
|
||||
uniform float m_SubPixelShift;
|
||||
varying vec4 posPos;
|
||||
void main() {
|
||||
gl_Position = inPosition * 2.0 - 1.0; //vec4(pos, 0.0, 1.0);
|
||||
@ -11,5 +11,5 @@ void main() {
|
||||
vec2 rcpFrame = vec2(1.0/g_Resolution.x, 1.0/g_Resolution.y);
|
||||
posPos.xy = inTexCoord.xy;
|
||||
posPos.zw = inTexCoord.xy -
|
||||
(rcpFrame * (0.5 + m_SubPixelShif));
|
||||
(rcpFrame * (0.5 + m_SubPixelShift));
|
||||
}
|
@ -15,7 +15,7 @@ import com.jme3.renderer.ViewPort;
|
||||
*/
|
||||
public class FXAAFilter extends Filter {
|
||||
|
||||
private float subPixelShif = 1.0f / 4.0f;
|
||||
private float subPixelShift = 1.0f / 4.0f;
|
||||
private float vxOffset = 0.0f;
|
||||
private float spanMax = 8.0f;
|
||||
private float reduceMul = 1.0f / 8.0f;
|
||||
@ -28,7 +28,7 @@ public class FXAAFilter extends Filter {
|
||||
protected void initFilter(AssetManager manager,
|
||||
RenderManager renderManager, ViewPort vp, int w, int h) {
|
||||
material = new Material(manager, "Common/MatDefs/Post/FXAA.j3md");
|
||||
material.setFloat("SubPixelShif", subPixelShif);
|
||||
material.setFloat("SubPixelShift", subPixelShift);
|
||||
material.setFloat("VxOffset", vxOffset);
|
||||
material.setFloat("SpanMax", spanMax);
|
||||
material.setFloat("ReduceMul", reduceMul);
|
||||
@ -52,9 +52,9 @@ public class FXAAFilter extends Filter {
|
||||
* @param subPixelShift
|
||||
*/
|
||||
public void setSubPixelShift(float subPixelShift) {
|
||||
subPixelShif = subPixelShift;
|
||||
this.subPixelShift = subPixelShift;
|
||||
if (material != null) {
|
||||
material.setFloat("SubPixelShif", subPixelShif);
|
||||
material.setFloat("SubPixelShif", this.subPixelShift);
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,8 +85,8 @@ public class FXAAFilter extends Filter {
|
||||
return spanMax;
|
||||
}
|
||||
|
||||
public float getSubPixelShif() {
|
||||
return subPixelShif;
|
||||
public float getSubPixelShift() {
|
||||
return subPixelShift;
|
||||
}
|
||||
|
||||
public float getVxOffset() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user