Jump to content

Directional light lights everything?


Rick
 Share

Recommended Posts

The directional light seems to light up everything (even "in-doors"). Is there a way we can better simulate the sun where it doesn't penetrate buildings/hallow boxes?

 

Maybe we can have certain materials ignore directional lighting only but "see" other kinds of lights? Not 100% ideal but might help in certain situations like housing that shouldn't have the sunlight in the house (if shades over windows down). We could probably do some godrays to simulate sunlight coming in if we wanted that.

 

I was able to make a shader to ignore ambient lighting (pretty easy :) ), but not sure if shaders can tell the difference between directional lights and the other light forms.

Link to comment
Share on other sites

You can customize a shader to ignore directional light and paint your inside walls with a material which uses this shader.

Open up shader fragment :

 

Find :

 

 	
//Distance attenuation
attenuation = lightposition[i].w * max(0.0, 1.0 - distance(lightposition[i].xyz,ex_VertexCameraPosition) / lightrange[i]) + (1.0 - lightposition[i].w);

 

After Add :

if (attenuation == 1.0) continue;

  • Upvote 1

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Thanks shadmar, that worked! It's pretty neat to see the inside of my building pitch black when I have a directional light and ambient light turned up. Of course the downside is as stated that "windows" don't shine any light in at all. Would be really cool if you could do this Josh, and would give a more real feel. I don't recall if LE2 did this or not?

 

For now I think I might be able to get away with spotlights angled to look like light coming in from a window or open door.

Link to comment
Share on other sites

Yeah. le2 had the same problem. I mentioned it both then and recently with Leadwerks 3. All I could do with le2 was to try and rotate the light away from buildings. It didn't work very well.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

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...