[osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Christian Buchner
Hi everyone. I am currently looking for a couple of OSG samples. Maybe someone can offer a pointer or link to some existing code demonstrating the techniques. 1) one minimal code sample demonstrating the use of GLSL for vertex and fragment processing (e.g. render a triangle). This is because I

Re: [osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Robert Osfield
Hi Cristian, osgshader and osgreflect seem like the obvious candidates... Robert. On Fri, Sep 2, 2011 at 11:20 AM, Christian Buchner christian.buch...@gmail.com wrote: Hi everyone. I am currently looking for a couple of OSG samples. Maybe someone can offer a pointer or link to some existing

Re: [osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Christian Buchner
Thanks I will look into osgreflect. regarding osgShader, I think it is a bit too crowded to be used for starters. A lot of OpenGL ES books start with minimal samples that just render a triangle with shaders. Essentially I am looking for an OSG based equivalent. Christian

Re: [osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Sergey Polischuk
Hi, Christian Use of glsl in osg is pretty straitforward. You create osg::Program (wrapper around gl program), osg::Shader(s) (wrapper around gl shader), set shader source with one of interface functions (or load from file), add them to program and set this stuff to stateset. If you use custom

Re: [osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Christian Buchner
Use of glsl in osg is pretty straitforward. Thanks for the hints so far. I condensed osgshaders into this short piece of code. It is self contained and nearly minimal, apart from -animating the Uniform variable for show effect -shaders doing a little more than the necessary minimum

Re: [osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Sergey Polischuk
It is problematic to make dynamic reflect\refract rendering with a single node, because you need rtt cameras with scene surronding your object. If you add cameras into object with reflections itself, you need surronding scene in separate graph (to avoid creating cycled graph). If you have

Re: [osg-users] OSG samples wanted 1) minimal GLSL sample, 2) dynamically render to cube map, use for reflection

2011-09-02 Thread Christian Buchner
It is problematic to make dynamic reflect\refract rendering with a single node, because you need rtt cameras with scene surronding your object. My approach would have been node masks to remove rendering unwanted objects from the main graph. I'll think about it more. Christian