Jump to content
  • Advertisement
Sign in to follow this  
Ziggy Stardust

GLSL screenspace effect

This topic is 4418 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Thanks zedzeek!

That was what I was looking for. Somehow I missed the fact that RenderMonkey can render to the screen, and then to a texture.

I will try this.

Ziggy

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!