Real-time glow
Original Source: http://xreal.51.net/Game/realtimeglow.htm
The so-called glow refers to the appearance of some halo next to an object, which is usually produced by an object that can emit light or is relatively dark in the scenario. In addition, these objects will look brighter than themselves.
In fact, it is very easy to generate glow. Here I will briefly describe it:
1: rendering the scenario in normal mode.
2: only render objects with glow effect. at this time, we will render it into a texture, which can be smaller than viewport. during rendering, we no longer use the diffuse information, but use the glow information. for example, we may want the glow on his face to be heavier. other places are smaller. there is glow in the light of a building. there is no such thing in other places. we can save this information in a common diffuse texture (with diffuse itself, or alpha channel) or a dedicated glow information texture. after the texture is rendered, the texture stores the extra brightness information on the screen only when there is a glow object.
3: Perform blur on the texture in step 2 and blur it to a certain extent in the x-y direction. so that the glow information originally only on the object spreads to both sides. of course, you can also stretch the object along the normal direction when rendering 2. (I used both methods ).
4: Finally, paste the texture after Step 3 to the screen, that is, add the glow information back to the scene, and apply the texture using the add method.
For details about real-time glow, see GPU gems.
The following is an example of rendering with rendermonkey:
Http://xreal.51.net/Download/RTGlow.rar
Http://xreal.51.net/Game/glow/glow1.jpg
Http://xreal.51.net/Game/glow/glow2.jpg
Http://xreal.51.net/Game/glow/glow3.jpg
Xheartblue-2005-3-7