Rain effects, better lighting model, optimized code

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Add media Report RSS FUEL 2021 01 29 13 55 04 631 (view original)
FUEL 2021 01 29 13 55 04 631
embed
share
view previous next
Share Image
Share on Facebook Post Email a friend
Embed Image
Post comment Comments
tundrowalker Author
tundrowalker - - 81 comments

These gray silhouettes are the result of just piping through the materials lighting from the mega-shader that handles vehicles, riders, buildings, etc.

I passed in a static lighting value of 1 to the materials lighting function, and, as you can see, two different results got returned:

* in the game menu, a very light colored gray
* in the game, a dark gray

The objective of the materials lighting is to setup a base lighting tone for objects. EG: you can have vehicle bodies be lighter toned, and have wheels in wheel wells be darker toned, either to simulate ambient occlusion due to wheel well blocking light, or because the tires need to be darker / blacker rubber.

But, the value passed in to the game seems to change based on menu vs. play. These values, if using the same light value each time, should produce the same results whether in-game or in-menu. So, there's no consistency, which makes it hard to code around when you don't know what's changing, when or how.

Also, the materials lighting for some things just makes no sense.

EG: the General Custer offroad car has a darker body and lighter wheels. This makes no sense, because the wheels are in wheel wells, and thus should be darker to simulate base ambient occlusion. I kept wondering why the Custer kept looking like it had dark paint with bright wheels for a while, until I realize this materials lighting algorithm was screwing me over on that.

The biggest issue with this is that it adds in an extra adjustment to lighting on vehicles, etc that other things (ground, plants, water) don't have. In sunny skies, it's not too noticeable, but, in overcast skies, it makes these things stick out like a sore thumb. Your vehicle and rider sit there unnaturally dark-looking compared to their surroundings.

So, I killed the materials lighting algorithm.. b/c it seemed half-baked.

But, then I noticed the haze around gate lights and the sandy spots in Dustbowl city on the asphalt were pure white and stuck out like sore thumbs. So, the materials lighting WAS helping a few things.

So, then I had to create an obstacle course of flag branching in the shader to isolate just the things that would need the materials lighting while leaving other things, like vehicles/riders, alone.

Huge PITA.

This is why you have to experiment with things piped in to you from a game engine.. you need to see what they look like as-is, so you can realize if they're set properly or not, and how they might impact what you're working on.

Reply Good karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: