Virtex Edge Design
  • Home
  • Portfolio
  • Blog
  • Discord
  • About
June 14, 2018 by virtex.edge
Dev Blog, Shader Series, Tutorials, Vertices Engine

Shader Series – Emissive Materials

Shader Series – Emissive Materials
June 14, 2018 by virtex.edge
Dev Blog, Shader Series, Tutorials, Vertices Engine

Selective Bloom, Emissive Glow, Fake HDR, there’s a number of ways to call this, but with Metric Racer being a scifi racing game, there was a need to make it look, well, scifi-ish. What that meant was a lot of sharp corners, chamfered structures and a lot of bright neon colours that pop from the screen. To achieve this, I was able to quickly modify a few shaders to get this result. You can see below the final result.

Metric uses the, Vertices Engine which uses a deferred rendering pipeline for it’s 3D graphics. The first pass involves drawing to 4 render targets at the same time, a high precision Depth Map, Normal Map, Distortion Map, and a Surface Data Map. This last map holds the specular data, along with shadow factor and the value for an emissive map. It’s this value from the emissive map that we’re interested in.

Faking the Glow

In a general bloom, the entire scene is used when extracting the bright portions. This can sometimes work well but often times gives a washed out or overly soft look to a scene.

For the emissive map though, when the bloom shader extracts the bright portions, it only does so for regions where the emissive map allows it to. This let’s us perform a selective bloom which sort of ‘fakes’ an HDR look by letting us highlight certain area’s of the screen and give the impression that certain area’s are brighter or “glow”.

The base scene with no selective bloom applied
The scene with selective bloom

Fine Tuning

The value of this emissivity can be controlled in multiple ways as well.

Boolean Control

First, there’s the boolean ‘yes-no’ for the full screen or emissive bloom. You can see this in the property grid control.

The Property Control Bloom Values. The bloom is amped up in this image compared to the previous one.

Surface Maps

Then there’s the emissive map, which comes from the alpha channel of the models surface condition map (which also holds the Specular power in the R channel, Spec Intensity in the G, and Reflection Amount in the B). By Fading the alpha value of this map, I can have tighter control on which parts of the model are more emissive.

The Diffuse Texture, Normal Map and Surface Data Map (Pink/Purple represents Alpha for illustrative purposes only)

Per Object Factors

And finally, there’s a per-object Emissive Glow Intensity factor in the shader which multiplies the emissive map value, allowing for items to pulse, hum or cycle their emissive values, which would be useful with an object like a light flickering.

To Pre-Multiply or Not, That is the Question

Another option which gives different results is whether to apply pre-multiplied alpha to surface data texture map during the content build step. Assuming the emissivity value, which is held in the alpha channel, is a full transparency, and If I pre-multiply the alpha, then that knocks out the RGB values altogether, meaning no specular or reflections will be passed through the pipeline for that area. Turning off pre-multiply will allow the specular/reflection data to pass through along with the emissive data. This would be useful say for a computer screen where there would be emission along with reflections and surface details.

Next Steps

I’m really happy with how this has turned out. But while doing the selective bloom, this completely negates any specular highlighting from the scene. The next step is going to be to extract any and all specular highlights and lighting data from the deferred rendering lighting pass and pass those highlights into the bloom extract pass.

Final Thoughts

This took almost no time at all to implement. After getting it working in the Vertices Test Bed, the results were evident immediately in Metric. Adding a center glow to the track helps lead the player around the course and adding an emissivity to the start of explosions gives a larger punch and emphasis to them. This effect, while trivial in it’s implementation, has added greatly to the flexibility of Vertices and the final look of Metric.

The subtle glow from the center blue lines

The subtle glow is even more evident on one of the Mars Sections:

A more contrasting blue glow on the outside lines.

 

blender Coding Design Editor Game Design Game Editor Game Engines Games Gaming Indie Games MonoGame Programming Tools videogames Xamarin XNA

Previous article3D GizmoNext article Shader Series - Camera Motion Blur

1 comment

R.T. says:
June 26, 2018 at 4:07 pm

Reblogged this on rtroe and commented:

The first entry in a weekly shader series I’m starting is on Emissive Materials, or essentially, applying a selective bloom over a scene. The effect is simple and easy to plug into any rendering pipeline given a bit of flexibility. Click below to check it out.

Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About The Blog

Virtex Edge Design is a a software design company which focuses  Game Development and design of 3D Development Tools.

Recent Posts

Indie Racers 2023!August 30, 2023
V0.9.2 – Cross Platform Track Sharing Out Now + Indie Racers Fest ’23August 30, 2023
INDIE RACERS FESTIVAL 2022!August 26, 2022

Categories

  • Apps
  • Chrome Extensions
  • Design
  • Dev Blog
  • Events
  • Games
  • Metric Racer
  • Preview
  • Shader Series
  • Space Esc8bit
  • The Chaotic Workshop
  • Tutorials
  • Uncategorized
  • Vertices Engine

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tags

Android blender C# Chrome Coding content generation Design Editor Extensions Extentions Game Design game dev Game Editor Game Engines Games Gaming Graphics HLSL Indie Game Dev Indie Games indie racers indieracers iOS Metric Racer MonoGame Pew Pew Pew Programming Racing racing games Scifi sharing solo SoloDev Solo Indie Dev Steam Steam Workshop Tools Tutorials videogames Visual Studio Web Wipeout Xamarin XNA Youtube

Virtex Edge Design

Virtex Edge Design is an Interactive software design company which focuses on Game Development, immersive experiences and design of 3D Development Tools.

Contact

Victoria, British Columbia
contact@virtexededesign.comvirtexede.design

Recent Posts

Indie Racers 2023!August 30, 2023
V0.9.2 – Cross Platform Track Sharing Out Now + Indie Racers Fest ’23August 30, 2023
INDIE RACERS FESTIVAL 2022!August 26, 2022
Rife Wordpress Theme. Proudly Built By Apollo13

About

Virtex Edge Design is an Interactive software design company which focuses on Game Development, immersive experiences and design of 3D Development Tools.

Recent Posts

Indie Racers 2023!August 30, 2023
V0.9.2 – Cross Platform Track Sharing Out Now + Indie Racers Fest ’23August 30, 2023
INDIE RACERS FESTIVAL 2022!August 26, 2022

Categories

  • Apps
  • Chrome Extensions
  • Design
  • Dev Blog
  • Events
  • Games
  • Metric Racer
  • Preview
  • Shader Series
  • Space Esc8bit
  • The Chaotic Workshop
  • Tutorials
  • Uncategorized
  • Vertices Engine

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org