Hello Carsten,
On 30.11.2012 00:57, Carsten Neumann wrote: > > in my view the programming model with shaders changes quite a bit. Due > to their flexibility shaders become more or less the entire rendering > state and there is no modularity any more. Or rather there is no > pre-determined modularity any more, it becomes the shader author's > responsibility to decide how much/at what level modularity is needed and > then write the code accordingly. That way you get to pick the sweet spot > between flexibility and performance for your application - at the cost > of being forced to pick it yourself ;) ;) > Yes > One way to get some of that modularity back is to use an "Über-Shader", > i.e. one that can handle all sorts of different rendering scenarios by > executing parts of it conditionally. > This can be achieved in different ways: for example by using the > preprocessor, if() statements that test boolean uniforms or by writing a > shader that calls a bunch of functions for different processing steps. > These functions can be compiled separately and then linked together into > the shader program. > This was my intention, actually. > > lighting and texturing is entirely up to the code of your shader, so it > is entirely up to the author to pick a suitable way to control these. Yes, I have known that from the Orange Book. > > Two geometries that use the same shader code can execute it with > uniforms set to completely different values inside a single scene. > Placing a ShaderProgramVariableChunk in a ChunkOverrideGroup can be used > to achive that for branches of the scene. That is exactly the information that I was missing. With that infrastructure in place I can imagine how to proceed. :) Hello Alexander, did you know about this ShaderProgramVariableChunk? And if so, where did you find the information. OpenSG is a complex piece of software and sometimes it took me a while to found my way through it. Thank you both for taking the time to help me get running in this new shader world. Best, Johannes ------------------------------------------------------------------------------ Keep yourself connected to Go Parallel: TUNE You got it built. Now make it sing. Tune shows you how. http://goparallel.sourceforge.net _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users