Assign textures in depth-only pass (fixed state desync bug)
This commit is contained in:
parent
b532ccd68f
commit
8207743308
10
src/k3.c
10
src/k3.c
@ -1749,6 +1749,7 @@ void k3PassDepthOnly(mat4 projection, mat4 cam, int clear, int cull) {
|
|||||||
|
|
||||||
setup_core_projection(glslp, projection);
|
setup_core_projection(glslp, projection);
|
||||||
|
|
||||||
|
bind_mat_textures(mat, 0);
|
||||||
setup_glsl_mat_uniforms(glslp, mat, 0);
|
setup_glsl_mat_uniforms(glslp, mat, 0);
|
||||||
|
|
||||||
setup_glsl_model_uniforms(glslp, modelmat);
|
setup_glsl_model_uniforms(glslp, modelmat);
|
||||||
@ -1783,6 +1784,15 @@ void k3PassDepthOnly(mat4 projection, mat4 cam, int clear, int cull) {
|
|||||||
glLoadMatrixf((float*) modelview);
|
glLoadMatrixf((float*) modelview);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!k3IsCore) {
|
||||||
|
if(mat->passes[0].alphatest) {
|
||||||
|
glEnable(GL_ALPHA_TEST);
|
||||||
|
glAlphaFunc(GL_GREATER, 0.9f);
|
||||||
|
} else {
|
||||||
|
glDisable(GL_ALPHA_TEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, mdl->vstore->gl);
|
glBindBufferARB(GL_ARRAY_BUFFER_ARB, mdl->vstore->gl);
|
||||||
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mdl->estore->gl);
|
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mdl->estore->gl);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user