PDA

View Full Version : Render into Texture



Andru
21-02-2011, 12:30 PM
I want to share with you some interesting fact about rendering into texture in different engines/libraries/etc., and I want to test some of them, which are you using(Andorra2D, Asphyre, Phoenix, whatever else, except ZenGL and quad-engine, because I know how they works :)).

So, here the only needed resource:
http://zengl.org/tmp/test01_render_target/tux_stand.png

Here the step-by-step operations for reproducing "interesting" effect:
- create window with size 256x256
- create and set current Render Target, which must be absolutely transparent(color - 0, alpha - 0)
- render white rectangle with size 256x256 and alpha equal to 255
- render penguin(size - 64x64) in coordinates 96, 96(or just in center - 128,128 ) with normal blending
- switch to scene
- render content of Render Target using normal blending mode

At the end you must get something like this:
http://zengl.org/tmp/test01_render_target/result.png

Attach your screen here and describe which engine did you use. Most of engines(I think so) will show you little bit grey penguin instead of "cute and white" :) Like this:
http://zengl.org/tmp/test01_render_target/result_bad.png

Darthman
21-02-2011, 12:43 PM
Sorry but I can't stand and not to post in this thread. 8)
This interesting bug, Andru mentioned above, is really like second picture. Gray penguin (OMFG). I add from myself, that if rendertarget will be transparent and non black (green for example), then penguin will be green too(ZOMGF)!
So Andru knew, but I anyway post my result after modification of sourcecode to avoid this "effect" (thanks Andru for idea):
http://quad-engine.com/temp/penguin.png

User137
21-02-2011, 03:59 PM
You propably mean of what happens when rendering a transparent image to uninitialized rendertarget?

Haven't added FBO or RenderBuffer to Next3D yet but *note to self*: Use this when time comes http://www.songho.ca/opengl/gl_fbo.html

Andru
21-02-2011, 04:03 PM
You propably mean of what happens when rendering a transparent image to uninitialized rendertarget?
Nope... this "problem" with uninitialized rendertarget is for children :)


http://www.songho.ca/opengl/gl_fbo.html
Here is no solution for problem above.

User137
21-02-2011, 06:04 PM
Here is no solution for problem above.
No but maybe solution to problem of how to render into texture :)

Dan
21-02-2011, 08:10 PM
Looks perfectly fine here (Gen2)

Murmandamus
21-02-2011, 11:57 PM
Could it potentially a lighting issue? In other words, "neutral" illumination vs "full bright"?

Just venturing a guess...

Andru
22-02-2011, 05:31 AM
Could it potentially a lighting issue? In other words, "neutral" illumination vs "full bright"?
If this reason was, then picture would be much worse :)

Dan
Thanks for the test. But you have some trouble with brightness of penguin... :)

Seems nobody else wants to help me with testing engines, so I will try to investigate engines myself )

About the "problem". For some reason this is not obvious for other developers, and they forget about Separate Blend, when they render into texture.

Traveler
22-02-2011, 10:12 AM
To be fair, one day is too short a time to request feedback from different engines. Also, I think the amount of engines used nowadays is minimal. I wonder how many people, not counting their creators, are using them.

Darthman
22-02-2011, 10:48 AM
Seems ur penguin, Dan, is quite brighter than it must be.