Jump to content

Exclude a material from lighting pass


Flexman
 Share

Recommended Posts

Once in a while you want to do something exotic which bends the rules slightly.

 

Is there a material setting that will exclude an object from a lighting pass? What I want to do is have the MFD material that is the screen area not be subject to the green pointlight above it.

 

There's a 'glass' layer over the screen that shows the green point light when the layer behind the glass is showing a bright image. These attached images show the green light reflecting when the video underlay is both active and switched off. If I hide the faux glass cover it's fine.

post-52-0-20180800-1303751087_thumb.jpg

post-52-0-16488700-1303751726_thumb.jpg

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

The GI shader does something like this. Can't be any more specific than that, off the top of my head.

 

You could also emit black diffuse light and put all the color into the emission channel.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I looked at the shaders and scratch my head for a bit then realised something I hadn't tried. Normals.

 

By adding LW_FULLBRIGHT to fix the normal on the glass plate that covers the screen it fixes the glare (and another issue relating to camera angle and the video underlay).

 

Here's the final mesh_cubemap_glass.frag shader header.

 

#define LW_DIFFUSE texture0
#define LW_CUBEMAP texture1
#define LW_FULLBRIGHT
Include "mesh.frag"

 

And the material file...

 

texture0="abstract::apache_pit_mpd_glass_skin.dds"
blend=1
depthmask=0
depthtest=1
overlay=0
zsort=1
cullface=1
castshadows=0
specular=13.50000000
gloss=0.10000000
shader="abstract::mesh_diffuse.vert","abstract::mesh_cubemap_glass.frag"

 

It does the job preventing the night lighting from obscuring the screen and it retains the cubemap reflection. So all in all quite pleased, I learned a bit more about emission and specular channels too. That might be really handy when it comes to do the infra-red night vision stuff.

post-52-0-12284500-1303816117_thumb.jpg

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...