Jump to content
  • Advertisement
Sign in to follow this  
Unikorn_1982

How to make a full screen glow effect as world of warcraft

This topic is 4286 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,everyone ! i am about to create a full screen glow like world of warcraft.Glow in wow is very soft ,and it is really great ! how to achieve it ? Help~~~~

Share this post


Link to post
Share on other sites
Advertisement
I don't mean to sound harsh, but if you can't figure that out on your own you should probably rethink what you're wanting to do. What exactly have you done as far as programming is concerned? No one is going to be able to just tell you how to do this effect because it is completely dependant on the structure of your code, how you have your rendering system set up etc.

Now if I'm incorrect in my assumptions that something like this may be out of your league right now (not that it will be for long, just seems like you don't really have the knowledge to worry about a very specialized effect like this currently) then I would tell you that this effect is done using some sort of shaders. Now I'm assuming they drop everything into a photonegative type scale by changing the color at each fragment to 1 - current_color (pseudocode). Then they probably have some sort of blurring and maybe even a glow on top.

In GLSL the first part is trivial (however WoW is written in D3D so the shaders would be in HLSL or possibly Cg), in the fragment shader you would simply do

gl_FragColor.rgb = 1.0 - gl_FragColor.rgb;
gl_FragColor.a = 1.0;

That's a good place to start at least, then look into blurring your scene and possibly adding some soft glowing effects

Share this post


Link to post
Share on other sites
If you want to achieve it without shaders, you can do a simpler method. Used in Need For Speed underground and many other games.

- You render your scene (Or only the things that should glow, the rest of it in black) on a 128x128 area. glViewport(0,0,128,128); (assuming you are using opengl!?)
- Then, you copy those pixels into a buffer. (Search google for that, dont remember the function, but its pretty simple).
- Then, you will need to blur* that buffer. Take each pixel and take the average of the 8 around it. (This part can slow down the game).
- Copy your buffer to a texture.
- Then, render your scene again at full resolution.
- After render this texture on a quad covering the screen with alpha blending : GL_ONE, GL_ONE. (add)

Et voilà.
The result will not looks smooth as with shaders, but if you dont want to bother with shader or you are like me (GeForce4) that can not afford those kind of shader, use this method.

You should result something like this :
http://www.rndlabs.ca/daivuk/Images/07Lightmaps/HRMap3.jpg

Taken from my engine. See the white glow on the lights and at the left. It's a HDR faking.

Have fun.

Share this post


Link to post
Share on other sites
Quote:
Original post by Daivuk
If you want to achieve it without shaders, you can do a simpler method. Used in Need For Speed underground and many other games.

- You render your scene (Or only the things that should glow, the rest of it in black) on a 128x128 area. glViewport(0,0,128,128); (assuming you are using opengl!?)
- Then, you copy those pixels into a buffer. (Search google for that, dont remember the function, but its pretty simple).
- Then, you will need to blur* that buffer. Take each pixel and take the average of the 8 around it. (This part can slow down the game).
- Copy your buffer to a texture.
- Then, render your scene again at full resolution.
- After render this texture on a quad covering the screen with alpha blending : GL_ONE, GL_ONE. (add)

Et voilà.
The result will not looks smooth as with shaders, but if you dont want to bother with shader or you are like me (GeForce4) that can not afford those kind of shader, use this method.

You should result something like this :
http://www.rndlabs.ca/daivuk/Images/07Lightmaps/HRMap3.jpg

Taken from my engine. See the white glow on the lights and at the left. It's a HDR faking.

Have fun.


Are you blurring the buffer in system memory and on the cpu or doing it all on the graphics card?

Share this post


Link to post
Share on other sites
If you're using OpenGL, are you just using glReadPixels to get the screen data, or the DirectX equivalent? Isn't this slow?

Share this post


Link to post
Share on other sites
glReadPixels is remarkably slow -- you should consider using FBO with OpenGL when/if supported.

Share this post


Link to post
Share on other sites
Instead of doing a glReadPixels you can bind a texture and then use glCopyTexImage2D to copy the framebuffer into it. Then, render a full screen quad with the copied texture several times, each time scaling the texture coordinates.

There's an example at nehe's site and also at Valve's site.

There's also a render to texture ARB extension for OpenGL.

cheers
sam

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!