Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom decode velocity function compilation error #7

Open
rwesterlund opened this issue Apr 23, 2015 · 1 comment
Open

Custom decode velocity function compilation error #7

rwesterlund opened this issue Apr 23, 2015 · 1 comment

Comments

@rwesterlund
Copy link

When defining SMAA_DECODE_VELOCITY to point towards a function that takes a float4 vector an error is generated at line 1323 because the input will be a float2 from swizzling the rg components of the texture sampling, whereas in the other three cases there is no swizzling so a float4 is passed.

@bryanwagner
Copy link

I was just about to create an issue for the same bug. There's an error in the usage of the SMAA_DECODE_VELOCITY macro here on line 1323:

float2 velocity = -SMAA_DECODE_VELOCITY(SMAASamplePoint(velocityTex, texcoord).rg);

It assumes the value returned from SMAASamplePoint only uses components rg. In other words, a float2 is passed to the macro. This is an error because it conflicts with the other uses of the SMAA_DECODE_VELOCITY macro. For example, see line 1272:

float2 velocity = SMAA_DECODE_VELOCITY(SMAASampleLevelZero(velocityTex, texcoord));

Notice this line passes the entire float4 to the macro, instead of the float2.

The fix is to change line 1323 to pass the entire float4 to the macro:

float2 velocity = -SMAA_DECODE_VELOCITY(SMAASamplePoint(velocityTex, texcoord));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants