hisprofile / blenderstuff

Guides made by me after 7 years of experience, diving into Blender's inner workings.
321 stars 36 forks source link

Radial fog is missing #3

Open wolfestridershooter opened 5 months ago

wolfestridershooter commented 5 months ago

Valve Source Engine games from L4D1 onward use a radial technique for rendering fog which looks far better than the planer one method. Radial fog is missing from the Source Engine Blender Collection fog shader.

From VDC: "Older Source games render fog as a plane a certain distance away from the camera. This method is bad, as rotating the camera will strengthen or weaken the apparent amount of fog in a particular spot, even though the viewer hasn't moved at all. In Left 4 Dead[confirm] onward, this is fixed by implementing a new radial method which is independent from the viewing angle."

Source: https://developer.valvesoftware.com/wiki/Env_fog_controller

hisprofile commented 5 months ago

hey there, thanks for submitting this.

can you provide comparisons between the two methods (and possibly more on the radial fog)? the current fog method implementation is also independent on view angle, so if this isn't similar to the radial fog method, i'm not sure what is

I-madeanaccounttomake-issuereports568 commented 2 months ago

Old flat fog (view angle) {55758D92-1E3D-430E-BB06-C89676081088} {F6DC892B-148A-4C98-A96E-276FF8712B94} In picture 2, the camera hasn't moved, just turned, yet it can see more of the right suzanne even thought it should be out of view

Radial fog {07703259-16A6-4AB3-AE8E-8CED7D46E5CD} {DBFFB541-E69B-46D2-8F17-C477C4B402C6} In picture 4, the camera, yet again, has only moved, but, the right suzanne, who hasn't moved the whole time, has the same visibility, since the visible part is still in the visible distance

used planes and uv spheres because I don't know how to use Blender's mist, pretend they are just fading out.

image image image