Browse Source

shader: default fog exponential density to 0 if fog is disabled

rdb 5 years ago
parent
commit
c81bfb09b7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      panda/src/display/graphicsStateGuardian.cxx

+ 2 - 1
panda/src/display/graphicsStateGuardian.cxx

@@ -1017,7 +1017,8 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name,
       _target_rs->get_attrib_def(FogAttrib::get_class_slot());
     Fog *fog = target_fog->get_fog();
     if (fog == nullptr) {
-      return &LMatrix4::ones_mat();
+      t.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1);
+      return &t;
     }
     PN_stdfloat start, end;
     fog->get_linear_range(start, end);