Jump to content

[SOLVED] Interpolation Modifiers have no effect


photo

Recommended Posts

Hi,

I'm trying to use the interpolation modifiers in a shader (MODIFER_NOPERSPECTIVE etc), but when i export the shader, they don't appear in the glsl code. I can't find any examples on how to use them, is this correct:

STRUCT(GEOMETRY_OUT)
    INIT_POSITION
    INIT_OUT(float4,vertexColor)
    MODIFER_NOPERSPECTIVE INIT_OUT(float3,dist) 
END

The in the fragment shader i do this:

// Input data structure
STRUCT(FRAGMENT_IN)
    INIT_POSITION
    INIT_IN(float4,vertexColor)
	MODIFER_NOPERSPECTIVE INIT_IN(float3, dist) 
END

But it has no effect at all, regardless of the modifier used.
Also note that when exporting the shader with EXPORT_SHADER(X) the modifier does not appear there either:

in vec4 s_texcoord_vertexColor;
in vec3 s_texcoord_dist; 

void main() {
  ...

I believe they should read:

in vec4 s_texcoord_vertexColor;
noperspective in vec3 s_texcoord_dist; 

void main() {
	...

 

Am i doing something wrong?

Thanks for any help!

 

Link to comment

Hi Paul,

That's because the constant is not defined in <SDK>/data/core/shaders/opengl.h. You can try to fix this by changing the

#define MODIFER_NOPERSPECTIVE

to:

#define MODIFER_NOPERSPECTIVE noperspective

I also spot a typo in MODIFER, I guess it should be MODIFIER :) Will be fixed in the upcoming SDK update.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
  • 2 weeks later...
  • silent changed the title to [SOLVED] Interpolation Modifiers have no effect
×
×
  • Create New...