From 2915c6e670e30b9581b5a2646088982654702093 Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 1 Jan 2022 16:49:41 +0100 Subject: [PATCH] glgsg: Force transform_weight column to read (0, 0, 0, 1) if absent On NVIDIA cards, this doesn't seem to happen automatically. Fixes #1207 --- panda/src/glstuff/glShaderContext_src.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/glstuff/glShaderContext_src.cxx b/panda/src/glstuff/glShaderContext_src.cxx index 450fb69367..aad4305b20 100644 --- a/panda/src/glstuff/glShaderContext_src.cxx +++ b/panda/src/glstuff/glShaderContext_src.cxx @@ -2591,6 +2591,11 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) { _glgsg->_glVertexAttribI4ui != nullptr) { _glgsg->_glVertexAttribI4ui(p, 0, 1, 2, 3); } + else if (name == InternalName::get_transform_weight()) { + // NVIDIA doesn't seem to use to use these defaults by itself + static const GLfloat weights[4] = {0, 0, 0, 1}; + _glgsg->_glVertexAttrib4fv(p, weights); + } } }