Many games that are considered 'next generation' use sophisticated rendering effects such as hdr, bloom, and glow. This effect make environments more realistic, attractive, and simply put, nice to look at. Many programmer's achieve these effects through complex shader coding and the use of rendering surfaces, however, Truevision 3D comes with built-in glow functions to make it easier for your to get these effects into your projects.
If you would like to learn how to add a glow rendering effect to your games in Truevision 3D, follow the guided steps below.
Step One - Object Initialization
In order to make use of Truevision 3D's glow effects, it is required to use the 'TVGraphicEffect' object and the 'TVRenderSurface' object. Add this source code to your project's object declaration section,
public TVGraphicEffect tvGFXEffect;
public TVRenderSurface tvSurface;
And, after the engine has been initialized, add this code,
tvGFXEffect = New TVGraphicEffect();
tvSurface = Scene.CreateRenderSurface(512, 512, true);
tvGFXEffect.InitGlowEffect(tvSurface);
With the graphic effect object and the rendering surface created, continue below to implement the actual rendering of the glow effect.
Step Two - Rendering the Glow Effect
In the main loop's rendering code, place this source code before the engine's renderer is cleared with the 'Clear()' function,
// Render the Glow Surface
tvSurface.StartRender(false);
// Render any mesh that should affected by the glow here
// End the Surface Rendering
tvSurface.EndRender();
// Update the Graphic Effects
tvGFXEffect.UpdateGlow();
Make sure to add rendering code for any mesh you would like to be rendered with the glow effect between the StartRender() and EndRender() functions. To have the graphics engine render the glow effect to the screen, add this code before the engine's 'RenderToScreen()' method is called,
tvGFXEffect.RenderGlow();
Conclusion
Now, when you compile and run the project, objects place between the rendering surface's render tags should have a nice glow surrounding them. Make sure to adjust the glow intensity until the desired level of effect is reached.
Published by James Cloud
I like to program and do basically anything that has to do with technology and computers. View profile
- Cement Rendering for BeginnersWhen cement is combined with other materials, it makes a medium that is suitable for covering external walls in a decorative fashion.
Repairing a Shower Curtain with a Grommet ToolBoth shower curtains and tarpaulins have holes that eventually rip through, rendering them useless. Don't throw away a ripped tarp or damaged shower curtain. Repair ripped holes...- HP Pavilion 17.3" 1TB Laptop Reviews, Model: DV7-4080USThe HP Pavilion 17.3" 1TB Laptop, Model: dv7-4080us features a massive hard drive, super-charged processor and a large monitor, making this laptop an adequate desktop replacement.
- How To: Remove Programs Compiled from Source Code in LinuxThree step reference to removing software manually compiled from Source Code, using the Linux terminal.
NASA Scientist James Hansen Releases Source Code: Skeptics RejoiceJames Hansen of NASA GISS has been in the hot seat of late. Possibly due to negative feedback he has released the source code for the global temperature average calculations.
- CSharp .Net Tutorial: Loading Textures in Truevision 3D
- CSharp .Net Tutorial: Reading Mouse Input in Truevision 3D
- Csharp.net Tutorial: Drawing Particles with Truevision 3D
- Csharp.Net Tutorial: Drawing Sprites with Truevision 3D
- The Easy Way to Give Your Poser Characters a Healthy Glow Using Paint.net
- Csharp.Net Tutorial: Basic Ray Collision Detection with Truevision 3D
- How to Display HTML on a Website Without the Browser Rendering It



