Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadow contact issue in sample shadow-sapp.c #114

Open
lazalong opened this issue Dec 12, 2022 · 1 comment
Open

Shadow contact issue in sample shadow-sapp.c #114

lazalong opened this issue Dec 12, 2022 · 1 comment

Comments

@lazalong
Copy link

Hi

There is a shadow contact issue in the sample shadow-sapp.c.
You see it when the cube is near the floor.
Compiled with gcc & VSCode

To show the issue just added a float variable cy to the state struct and the following lines at 218:

    state.cy += 0.01 * t;
    float fff = sin(state.cy) * 2 + 0.95;
    const hmm_mat4 translate = HMM_Translate(HMM_Vec3(0,fff,0));

c-shadows-sapp

@lazalong
Copy link
Author

In fact it can be 'fixed' by adding 0.001 to the depth at line 154 of shadow-sapp.glsl

float depth = lightPos.z+0.001;

But that is purely by trying instead of understanding what I am doing ahaha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant