Paul.Withers Posted February 20, 2020 Share Posted February 20, 2020 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
silent Posted February 20, 2020 Share Posted February 20, 2020 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Paul.Withers Posted February 28, 2020 Author Share Posted February 28, 2020 Thankyou! :) Link to comment
Recommended Posts