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

Implement shadow maps #888

Open
ikabod-kee opened this issue Jan 2, 2025 · 10 comments
Open

Implement shadow maps #888

ikabod-kee opened this issue Jan 2, 2025 · 10 comments
Labels
experimental a feature or idea that will require lots of experimentation graphics

Comments

@ikabod-kee
Copy link
Collaborator

Something I noticed that was missing from Cubyz was shading. The trees don't have any shadows, making everything look quite flat.

image
image

@ikabod-kee ikabod-kee added undecided a final decision has not been made whether or how this enhancement should be implemented graphics labels Jan 2, 2025
@IntegratedQuantum
Copy link
Member

When you talk about shadows, are you referring to ambient occlusion? You could change that by just increasing the absorption of leaves.

@ikabod-kee
Copy link
Collaborator Author

No I don't mean the ambient occlusion. When sunlight hits the ground, it basically acts like a full white light block, spreading in every direction. Trees ought to have stronger shadows beneath them.

@IntegratedQuantum
Copy link
Member

IntegratedQuantum commented Jan 3, 2025

I don't think you really can achieve this with floodfill lighting.
I think shadow maps would be correct solution here, and given how little we are actually graphics bound now, they might even be viable.

@ikabod-kee
Copy link
Collaborator Author

:O Oh my god, they would look amazing in Cubyz. My friends have been complaining about how flat it all is anyways

@IntegratedQuantum
Copy link
Member

just to clarify, I'd only use a shadow map for sun and moon though.

@ikabod-kee
Copy link
Collaborator Author

That makes sense to me

@IntegratedQuantum IntegratedQuantum changed the title Make sunlight spread only a bit horizontally. Implement shadow maps Jan 3, 2025
@IntegratedQuantum IntegratedQuantum added experimental a feature or idea that will require lots of experimentation and removed undecided a final decision has not been made whether or how this enhancement should be implemented labels Jan 3, 2025
@IntegratedQuantum IntegratedQuantum added this to the Long-Term Goals milestone Jan 3, 2025
@ikabod-kee
Copy link
Collaborator Author

If you are going to implement these, please don't apply it to entities. Trust me, it'll save you a lot of trouble.

@IntegratedQuantum
Copy link
Member

What's the problem with entity shadows?

@ikabod-kee
Copy link
Collaborator Author

(Possibly) Laggy to calculate and look bad in my opinion. In 3d games like mario, shadows are cast directly down to the ground from the top to help gauge distance.

@IntegratedQuantum
Copy link
Member

Well, the mario method would require more resources because it would require evaluating two shadow maps for each pixel, one for terrain and one for the entities.

We'll see how it looks once we get there. It might not be that bad in a first person game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental a feature or idea that will require lots of experimentation graphics
Projects
None yet
Development

No branches or pull requests

2 participants