Hi Manfred, > Hi Folks, > > I have just found a little strange issue in the current snapshot > with respect to the NV texture shader functionality. > > Currently texture shaders are used by setting a shader op different > from NULL in the texturechunk. The problem occured when i was providing > the textureshader settings on my own using the corresponding glTexEnv- > calls. (as i had to for the OpenSG 1.2) > > With the new version, any time I activate a texture, it overwrites > the shader op with "GL_NONE", even if I did not want to use any texture > shader functionality. This is kind of strange since I would expect > the texture shader not to change anything it does not use.
Just for simplicity reasons, not really a technical reason. > I would, therefore, suggest that the texturechunk keeps the settings > untouched if no texture shader functionality is desired. > Anyway I don't like the enable functionality mixed up with the > shader op since I could think of more reasonable default values than > GL_NONE. (e.g. GL_TEXTURE_3D/2D for a 2D/3D texture) Well, in general texture shaders are not available, so none seesm to be a safe bet. As the chunks are issued separately they cannot know whether another active texture uses the shaders. > Another thing I don't like very much about the solution of putting > the texture shader functionality into the texture chunk is the way > I have to provide the shader op for different stages. Even if the > texture op does not require a teximage (e.g. in GL_DOT_PRODUCT_NV) > I have to provide a texture chunk for each stage. (BTW. does this > work without an Image attached to the chunk?) Probably not. > And the ordering > of the stages is just defined by the order of the addChunk calls > to the chunkmaterial, which in my opinion is quite error prone. > In my opinion it would be much cleaner to provide a TextureShaderChunk > just as the FragmentProgramChunk which holds the settings for ALL > 4 texture stages. Then, if I don't want it, I don't create it and > nothing in my OpenGL settings would be changed. > > Any opinions on that? The main idea behind the separation was to be able to easily extend the number of shaders, and in general my impression was that shader stages are linked to textures. I know in newer systems that's not true any more (but in those you probably use FragmentPrograms anyway), I'm not sure about older ones, though. But you could get the same effect by using a TextureShaderChunk with MFields for parameters. This won't allow you sharing of texture shaders, which admittedly is probably not a big deal. I don't have strong feelings about the texture shaders so I wouldn't mind changing it the way you described: remove them from the TextureChunk, and create a new TextureShaderChunk with MFields for the parameters. Comments? Dirk ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users