diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 0a1dc16a0b..d24272383c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -374,6 +374,10 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) : _white_texture = 0; +#ifndef OPENGLES + _shader_point_size = false; +#endif + #ifdef HAVE_CG _cg_context = 0; #endif @@ -6016,6 +6020,19 @@ do_issue_shader() { } } +#ifndef OPENGLES + // Is the point size provided by the shader or by OpenGL? + bool shader_point_size = _target_shader->get_flag(ShaderAttrib::F_shader_point_size); + if (shader_point_size != _shader_point_size) { + if (shader_point_size) { + glEnable(GL_PROGRAM_POINT_SIZE); + } else { + glDisable(GL_PROGRAM_POINT_SIZE); + } + _shader_point_size = shader_point_size; + } +#endif + report_my_gl_errors(); } #endif // !OPENGLES_1 diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index 43ba33bdfd..fcfe13c56a 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -608,6 +608,10 @@ protected: ShaderContext *_texture_binding_shader_context; static PT(Shader) _default_shader; + +#ifndef OPENGLES + bool _shader_point_size; +#endif #endif #ifdef HAVE_CG diff --git a/panda/src/pgraph/shaderAttrib.h b/panda/src/pgraph/shaderAttrib.h index fd6b26dffc..5e92b71011 100644 --- a/panda/src/pgraph/shaderAttrib.h +++ b/panda/src/pgraph/shaderAttrib.h @@ -49,6 +49,7 @@ PUBLISHED: F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel. F_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL F_hardware_skinning = 2, // Shader needs pre-animated vertices + F_shader_point_size = 3, // Shader provides point size, not RenderModeAttrib }; INLINE bool has_shader() const;