I've seen the penguin sample code that comes with Ogre. It modifies a texture texel by texel.
I need to replace some opengl code with Ogre, and in opengl a texture is created in the gpu and opengl has commands to draw a polyline, given a bunch of vertices.
Is there an equivalent in Ogre? Can I draw a line into a texture/pixel-buffer? Can I draw a font into it? I've searched a lot, but am completely confused with the number of API's present.
Drawing lines and fonts into a texture?
-
- Halfling
- Posts: 91
- Joined: Fri Sep 30, 2011 11:22 am
- x 2
- omniter
- OGRE Contributor
- Posts: 424
- Joined: Thu Mar 19, 2009 8:08 am
- Location: Canada
- x 44
Re: Drawing lines and fonts into a texture?
Sure, just use render-to-texture. Normally, you're rendering to the screen, but you can set the render target to a texture instead. The SDK contains a render-to-texture sample. In fact, there is code in there specifically to hide the overlays when rendering to texture so that you don't get GUI in the water reflections. Once, when I was converting that sample, I accidentally left that part out, and I saw buttons and text in the water. Pretty neat. I imagine that could be what you want.
-
- Halfling
- Posts: 91
- Joined: Fri Sep 30, 2011 11:22 am
- x 2
Re: Drawing lines and fonts into a texture?
Ah...that's possible? Cool! So I guess I can use ManualObject to draw lines and render it to a texture. Only disappointment was that manualObject didn't have functions for drawing circles etc.
A bit confusing as of now coz I didn't explore RTT etc. fully, but thanks so much! Will get back if I have any queries.
A bit confusing as of now coz I didn't explore RTT etc. fully, but thanks so much! Will get back if I have any queries.