From c81bfb09b73605b04dc65ee9c1f09d856177026b Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 30 Mar 2020 14:01:50 +0200 Subject: [PATCH] shader: default fog exponential density to 0 if fog is disabled --- panda/src/display/graphicsStateGuardian.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index d381706835..a7f2c41685 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/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);