mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Add flag enabling vertex shader control over point size
This commit is contained in:
parent
ebd1fd8462
commit
aca077916d
@ -374,6 +374,10 @@ CLP(GraphicsStateGuardian)(GraphicsEngine *engine, GraphicsPipe *pipe) :
|
|||||||
|
|
||||||
_white_texture = 0;
|
_white_texture = 0;
|
||||||
|
|
||||||
|
#ifndef OPENGLES
|
||||||
|
_shader_point_size = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
_cg_context = 0;
|
_cg_context = 0;
|
||||||
#endif
|
#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();
|
report_my_gl_errors();
|
||||||
}
|
}
|
||||||
#endif // !OPENGLES_1
|
#endif // !OPENGLES_1
|
||||||
|
@ -608,6 +608,10 @@ protected:
|
|||||||
ShaderContext *_texture_binding_shader_context;
|
ShaderContext *_texture_binding_shader_context;
|
||||||
|
|
||||||
static PT(Shader) _default_shader;
|
static PT(Shader) _default_shader;
|
||||||
|
|
||||||
|
#ifndef OPENGLES
|
||||||
|
bool _shader_point_size;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
|
@ -49,6 +49,7 @@ PUBLISHED:
|
|||||||
F_disable_alpha_write = 0, // Suppress writes to color buffer alpha channel.
|
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_subsume_alpha_test = 1, // Shader promises to subsume the alpha test using TEXKILL
|
||||||
F_hardware_skinning = 2, // Shader needs pre-animated vertices
|
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;
|
INLINE bool has_shader() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user