Skip to content

Commit

Permalink
UPBGE: Restore bind id for VSM shadow.
Browse files Browse the repository at this point in the history
Previously the shadow bind id returned by shadowBindId was the depth
map in case of simple shadow or the "moment" shadow in case of VSM.
This was recently unified to return only the depth map in the last
shadow refactor but broken some files using custom shader with VSM
"moment" map.
The previous behaviour is restored while waiting for a better API to
access to the two map in case of VSM.

Fix issue #576.
  • Loading branch information
panzergame committed Aug 29, 2017
1 parent acf534b commit 0164085
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/blender/gpu/intern/gpu_material.c
Original file line number Diff line number Diff line change
Expand Up @@ -2873,7 +2873,13 @@ int GPU_lamp_shadow_buffer_type(GPULamp *lamp)

int GPU_lamp_shadow_bind_code(GPULamp *lamp)
{
return lamp->depthtex ? GPU_texture_opengl_bindcode(lamp->depthtex) : -1;
if (lamp->tex) {
return GPU_texture_opengl_bindcode(lamp->tex);
}
else if (lamp->depthtex) {
return GPU_texture_opengl_bindcode(lamp->depthtex);
}
return -1;
}

const float *GPU_lamp_dynpersmat(GPULamp *lamp)
Expand Down

1 comment on commit 0164085

@youle31
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.