coin icon indicating copy to clipboard operation
coin copied to clipboard

poorly documented "Shaders in Coin"

Open VolkerEnderlein opened this issue 8 years ago • 1 comments

Original report by Anonymous.


hi. since your main page mentions:

#!

IMPORTANT NOTE: the online documentation for the Coin library is a continuous 
work-in-progress. 
Although the large majority of classes have been documented properly, there might 
still be some poorly documented items. 
If you happen upon an undocumented or poorly documented class and / or class 
method which you find hard to understand, please give us a notice so we can 
rectify the situation. 

(you did not write where to put such a notice i put it here)

neither "Shaders in Coin" nor any shader-class documentation mentions how to load a shader during execution (e.g. used to get the z-buffer).

the only documentation mentions how to add shaders to iv-files.

looking at the shader classes i was not able to find out how to load shaders during runtime and how to use them (e.g. for a SoOffscreenRenderer through a custom SoGLRenderAction.

if it is possible an example should be added.

if this is impossible it should be mentioned in "Shaders in Coin". if this is impossible this can be considered as a request to add this feature.

thanks raphael

VolkerEnderlein avatar Nov 06 '15 14:11 VolkerEnderlein

Original comment by Roy Walmsley (Bitbucket: walroy, GitHub: walroy).


Hi,

If you want to use shaders you have to insert a SoShaderProgram node into your scene graph. It will be applied to everything underneath it, unless you specify another SoShaderProgram. You can find the documentation for this node here (http://coin3d.bitbucket.org/Coin/classSoShaderProgram.html). This page also contains some examples.

Of course, since the shaders are embedded in your scene graph, they will apply no matter whether you are rendering to an SoOffscreenRenderer or direct to the screen.

Hope the above will get you going,

Regards,

Roy

VolkerEnderlein avatar Nov 07 '15 17:11 VolkerEnderlein