Page 1 of 1

Custom vertex shader with offscreen rendering

Posted: Fri Nov 30, 2018 11:34 pm
by dima5
Ogre Version: :?: 1.9
Operating System: :?: Linux/X11
Render System: :?: OpenGL

Hi. I'm trying to use ogre to render off-screen with a custom GLSL vertex shader. I have the off-screen rendering part working. As far as I can tell, to add a custom shared I'm supposed to viewport->getCamera()->getTechnique()->getPass(0)->setVertexProgram(...). But in my case the getTechnique() returns NULL. Am I supposed to create some default technique? How? Are there samples anywhere that demo any of this? Thanks.

Re: Custom vertex shader with offscreen rendering

Posted: Sat Dec 01, 2018 12:55 am
by paroj

Re: Custom vertex shader with offscreen rendering

Posted: Sat Dec 01, 2018 3:22 am
by dima5
Thanks for the reply. That page is interesting, but doesn't entirely tell me what I'd like to know. I have a Camera and a Viewport. There is no associated Technique, but something is being rendered successfully anyway. Do I need to create a Technique? How? The Material class has a createTechnique(), but I can't call it because camera.getMaterial() gives me a const Material. Pointers appreciated.

Thanks.