Skip to content

Commit d0d6075

Browse files
committed
make some changes to the path renderer in hopes windows gl drivers dont give up on them
1 parent 5d9fc61 commit d0d6075

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/UPathRenderer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ const char* default_path_frg_shader_source = "#version 330\n\
2525
uniform sampler2D spriteTexture;\n\
2626
in vec4 line_color;\n\
2727
flat in int pickID;\n\
28-
uniform bool pointMode;\n\
28+
uniform int pointMode;\n\
2929
out vec4 outColor;\n\
3030
out int outPick;\n\
3131
void main()\n\
3232
{\n\
33-
if(pointMode){\n\
33+
if(pointMode == 1){\n\
3434
vec2 p = gl_PointCoord * 2.0 - vec2(1.0);\n\
3535
float r = sqrt(dot(p,p)) * 0.5;\n\
3636
outPick = pickID; \n\
@@ -148,13 +148,12 @@ void CPathRenderer::UpdateData(){
148148

149149
void CPathRenderer::Draw(LSceneCamera *Camera) {
150150
glEnable(GL_DEPTH_TEST);
151-
glDepthFunc(GL_LESS);
151+
glDepthFunc(GL_LEQUAL);
152152

153153
glEnable(GL_BLEND);
154154
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
155155

156156
glEnable(GL_PROGRAM_POINT_SIZE);
157-
//glEnable(GL_POINT_SPRITE);
158157

159158
glLineWidth(2.0f);
160159

src/UPlaneRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void CPlaneRenderer::Init(std::string texPath){
139139

140140
void CPlaneRenderer::Draw(glm::mat4* transform, uint32_t id, uint32_t selected, int32_t texScaleX, int32_t texScaleY){
141141
glEnable(GL_DEPTH_TEST);
142-
glDepthFunc(GL_LESS);
142+
glDepthFunc(GL_LEQUAL);
143143

144144
glEnable(GL_BLEND);
145145
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

src/UPointSpriteManager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,12 @@ void CPointSpriteManager::UpdateData(){
157157

158158
void CPointSpriteManager::Draw(LSceneCamera *Camera) {
159159
glEnable(GL_DEPTH_TEST);
160-
glDepthFunc(GL_LESS);
160+
glDepthFunc(GL_LEQUAL);
161161

162162
glEnable(GL_BLEND);
163163
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
164164

165165
glEnable(GL_PROGRAM_POINT_SIZE);
166-
//glEnable(GL_POINT_SPRITE);
167166

168167
glm::mat4 mvp;
169168
mvp = Camera->GetProjectionMatrix() * Camera->GetViewMatrix() * glm::identity<glm::mat4>();

0 commit comments

Comments
 (0)