Rendering To Texture: I don't understand its purpose

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
Van
Hobgoblin
Posts: 512
Joined: Fri Nov 19, 2004 3:56 am
Contact:

Rendering To Texture: I don't understand its purpose

Post by Van »

I have scene the demo but I am not sure what Rendering to Texture really means/does and when/why I would need to use it. Would someone please explain to me what it does and why/when I should use this feature? Or point me in the general direction of a good explanation?
User avatar
monster
OGRE Community Helper
OGRE Community Helper
Posts: 1098
Joined: Mon Sep 22, 2003 2:40 am
Location: Melbourne, Australia
Contact:

Post by monster »

A couple of uses that spring to mind are;
- Mirrors/reflections - see the Fresnel demo or the menu screen of Tranz Oz - the mirror is a plane, the scene is rendered to a texture with the camera at a position equal to the reflection of the current camera in the mirror plane, then that texture is projected onto that plane
- You could also use it for the rear view mirror of a vehicle
- Texture shadows - see the Ogre manual (I think) or any article on texture based shadows.
- Use a different camera to render to a texture from a high viewpoint, or from the front of a missile, map that texture to an overlay or other Quad; hey-presto an overview map or "Desert Storm" style missle camera.
User avatar
Attis SH
Kobold
Posts: 28
Joined: Sun May 18, 2003 9:42 am
Location: Budapest, Hungary

Post by Attis SH »

Rendering your scene into the texture can be used for:
- mirrors
- reflections on water surfaces (ocean, lakes)
- security cameras (show a different place in your game world on a texture of an object)

This is what the RenderToTexture demo does.


There are other uses for Render to Texture, for example there are
terrain algorithms which generate textures for the terrain patches on the fly. This is best to do in the graphics hardware, but I don't know if or how you can do this in OGRE.
jonnii
Halfling
Posts: 81
Joined: Sat Jun 19, 2004 1:10 am

Post by jonnii »

It can also be used for a multitude of post process effects such as:
- warping the entire screen
- blurring
- depth of field
- stylistic/artistic rendering
- HDR

whatever your imagination can come up with basically.
Phonomania
Kobold
Posts: 26
Joined: Tue Sep 14, 2004 12:56 pm
Location: israel
Contact:

Post by Phonomania »

can "render to texture" be used for getting silhouette edges of animated mesh?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

sure, if you render to texture without lighting and a white material on a black background you have a nice silhouette (depending on the application you need to do some morphological edge detection, which is possible with a trivial fragment shader)
Phonomania
Kobold
Posts: 26
Joined: Tue Sep 14, 2004 12:56 pm
Location: israel
Contact:

Post by Phonomania »

fragment shader
i dont think my mobility radeon 7500 have some fragment program feature, but maybe i m wrong. it have pixel shaders up to 1.3. And i see this effect in game running with my card. Just wondering how those guyz make it. Them use silhouette for highliting picked human model - so those silhoettes made on fly , while mouse moves on model. i mean it works really fast. any ideas how this can be achieved?
zenic
Gnoblar
Posts: 5
Joined: Sun Mar 13, 2005 12:43 pm
Location: Australia

and most importantly...

Post by zenic »

Probably one of the more common uses of render to texture in games is rendering an environment map. Basically, if you want to have a car that reflects the scene around it nicely, render the 6 views by pointing a camera around from where the car would be in a scene, then use the textures as an environment map on the car's material. drive under a bridge and you will see it reflected on the car...
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Pixel shader = fragment shader
Phonomania
Kobold
Posts: 26
Joined: Tue Sep 14, 2004 12:56 pm
Location: israel
Contact:

render to texture

Post by Phonomania »

ok , i would ask about another thing. is it possible to make big set of sprites from animated model with this technique(RTT) on startup of aplication. ok , more presizely... is such way useful ?
I play with RTT demo , and i mention it is resource consumed. i have half of fps when use reflection from plane. I dont think i can use too much reflected viewports in same time on low end card.
maybe i have to describe aplication(game) i talk about. it used orto projection camera , isometric view , tiles, but i see some kind of modified mdl valve format models in resource section. those models use wide set of animation , but it have only 8 orientation position( its common for iso games , like diablo). intresting point that models look really nice... very detailed , them use very good clothing too - things like cape , wings with wind effect(their own animation). and there may be 300-400 avatars inside of viewport ... its starts degrade slightly when all people wear wings, but performance is really good for such amount of models.

So question is 1) if them just load model and view it - how them so easily achieve silhoette effect.
2) if them use init runtime prepeared sprites , how them produse it?
this game name is Mu Online , its Korean. it need directx8.1 compatible card.
maybe i just totally wrong about all this stuff , i need some clarification.
sorry if something unclear , my english is poor.
User avatar
Lucky_Luciano
Greenskin
Posts: 136
Joined: Mon Feb 14, 2005 9:25 pm
Location: Belgium

Re: render to texture

Post by Lucky_Luciano »

Phonomania wrote:ok , i would ask about another thing. is it possible to make big set of sprites from animated model with this technique(RTT) on startup of aplication. ok , more presizely... is such way useful ?
Sure thing! I wouldn't do it on startup of the application though (just do it once, let's say during the installation of the program. That way you can even keep the file-size of your game very small!).
Phonomania
Kobold
Posts: 26
Joined: Tue Sep 14, 2004 12:56 pm
Location: israel
Contact:

render to texture

Post by Phonomania »

i still dont know how achieve silhoette effect. i sow glow fx in dxsdk , but this is not what i exactly need. i just need simple red(whatever) boundary , surrounding my mesh.
This screen is what i achieved with edge detection pixel shader and render to texture. Someone can guid me what i can do further?

insert link in address bar of browser so it will not redirect on topcities homepage
http://phonomania.topcities.com/Silhoette.jpg
Post Reply