Hi Mustafa,
You could simply load all the shaders into different statesets and then
switch between the state sets
 (using osg::Node->setStateSet() I think ) at runtime. Then you don't have
to worry about adding/removing programs.
This is what we do for switching between different lighting models for our
volume rendering.
biv


On 8/24/07, Mustafa <[EMAIL PROTECTED]> wrote:
>
> Hi,
> I am trying to visualize an intensity volume cube
> (512*512*512*float) with some modifications to osgvolume project. I
> plan to use shaders to test different parameters and shader code.
> Because it is a huge volume file (~500MB), loading time is around 40
> seconds... Anyway, what I want to do is once I load this data into
> memory, I plan to apply different filters etc. on the data, so without
> compiling my application for every modification, I will change the
> shader codes and during the runtime I will delete the previous shader
> code on the GPU and load the new one. This will make my work easier
> because I dont need to wait 40 second each time to load the file or
> recompile the application.
>
> My Question:
>
> Existing osgvolume code is:
> ...
> program->addShader(vertex_shader);
> ...
> program->addShader(vertex_shader);
> ...
>
> What will be the right way to update the shader code (I will not use
> uniforms!, because I will test different algorithms not only changing
> the parameters...)
> Is the following lines correct ?
>
> ...
> program->removeShader(vertex_shader);
> ... // update shader code...
> program->addShader(vertex_shader);
> ...
>
> program->dirty(); // or somethign like this to be called?
>
>
> Best,
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to