Am 03.04.2018 um 10:39 schrieb Robert Osfield: Hi Robert, > > I can't see how you can reuse shaders that are from applications that > do their own shader preprocessing. The @ usage in question isn't > supported by GLSL or the OSG, and given both the OSG and GLSL support > #define's and there usage this is how those OpenMW probably should > have been written, especially given how the OSG's #pragma(tic) shader > composition system provide inserting of variables automatically for > you without an application special preprocessing. > Then let me ask in a different way: The obj plugin specifies texture in a predefined or custom order, which need to be propagated to shader code
In recent implementation of shadergen_vert.cpp there is #if defined(GL_TEXTURE_2D) gl_TexCoord[0] = gl_MultiTexCoord0; #endif which is used later in the related fragment shader as #if defined(GL_TEXTURE_2D) color = color * texture2D(diffuseMap, gl_TexCoord[0].st); #endif If I specify a different texture unit the vertex shader need to use a different gl_MultiTexCoord... variable e.g. the macro diffuseMap points to the related unit this would be #if defined(GL_TEXTURE_2D) gl_TexCoord[diffuseMap] = gl_MultiTexCoord <concat> diffuseMap; #endif and in the related fragment shader #if defined(GL_TEXTURE_2D) color = color * texture2D(diffuseMap, gl_TexCoord[diffuseMap].st); #endif How to solve this ? Ralf _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
