Sign in to follow this  
Ziggy Stardust

GLSL screenspace effect

Recommended Posts

Hi, I am developing a screen-space effect in GLSL using RenderMonkey. Say for example I want to add a simple glow to an object. What I would like to do, somehow: 1. Render my object to a texture, with the same size as my viewport 2. Blur the texture to a second texture to produce a glow 3. Add the blur to the original texture, and render to exacly the same spot on my viewport. Somehow, I can't accomplish this. Rendering to a texture with the size of a viewport seems to be the solution, but I haven't been able to align these textures (1 and 2) properly. RenderMonkey seems to use The examples provided with RenderMonky all seem to render the scene to a small (512 x 512) texture, and use the final texture to render to the viewport. This results in low-quality renders, and they aspect-ratio of the viewport is totally ignored. Can somebody point me into the right direction? [Edited by - Ziggy Stardust on June 12, 2006 11:39:57 PM]

Share this post


Link to post
Share on other sites
hang on to yourself
Quote:
to render the scene to a small (512 x 512) texture

u should use a texture the same aspect as the viewpoint eg i use one 1/4 the size ie 1024x768 i use 512x384 (texture_rectangle)

Quote:
3. Add the blur to the original texture, and render to exacly the same spot on my viewport.

u dont combine it with the original texture what u do is just draw a fullscreen quad blended over the tyop of the scene with that texture (u will need to change the glMatrixMode( GL_PROJECTION + MODEL_VIEW ) matrices

Share this post


Link to post
Share on other sites
Euhm I tried that before as well, I just didnt manage to get the texture the same size as the viewport lol... (Works fine with putting a normal texture fullscreen, but when it was edited by copyteximage2d, the texture wasn't stretched correctly. Soz a bit offtopic but worth mentioning ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this