-Fixed height fog (was broken)

-Make sure materials are named in OBJ importer, so they can be saved outside as resources.
This commit is contained in:
Juan Linietsky 2017-11-25 12:32:02 -03:00
parent e1cf789593
commit 9738ebcda0
3 changed files with 6 additions and 2 deletions

View file

@ -2048,7 +2048,7 @@ FRAGMENT_SHADER_CODE
if (fog_height_enabled) {
float y = (camera_matrix * vec4(vertex,1.0)).y;
fog_amount = max(fog_amount,pow(1.0-smoothstep(fog_height_min,fog_height_max,y),fog_height_curve));
fog_amount = max(fog_amount,pow(smoothstep(fog_height_min,fog_height_max,y),fog_height_curve));
}
float rev_amount = 1.0 - fog_amount;