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

Added pseudo3d functionality from pseudo3d branch for directional light. #122

Closed
wants to merge 4 commits into from

Conversation

kdenzel
Copy link

@kdenzel kdenzel commented Sep 1, 2020

Added (mainly for myself) the pseudo3d functionality for the directional light. Also tested it for my game i make. Would fix #68 and #40 i guess? Took some code from @rinold (good work tho) and altered it for my needs.

I saw in the pseudo3d branch that there are extra classes for handling pseudo3d but for my case i only needed the directional light and at the moment i guess this is the only light that really needs pseudo3d in my opinion. Dunno if pointlight or conelight needs this functionality (of course nice to have) cause in my top down shooter i use cone light only for flashlights and pointlights for street lamps, so they do not shine over the entire scene and therefore are finite and do not throw infinite shadows.

So i make this PR for discussion. Sorry for the whitespace issue, my IDE Netbeans auto formatted a lot of code. But you can compare the code with the w=1 switch in the URL.

Thanks for reviewing and hopefully i do not waste someones time. If you wanna see the sun cyclus you can run the DesktopLauncher from the test package and press F4 for directional light, but i guess you have to alter the path in the Box2DLightTest class to the resources cause Netbeans uses per default other path for resources.

…light, so we can simulate a sun cyclus. -Set Blendfunc back to Simpleblenfunc in render, so lights rendered after the origin won't be affected by dynamicshadow blending in PositionalLight and Directionallight.
kdenzel added 3 commits September 2, 2020 10:50
…w directly down on the field. Just add to the LightData the shadow=true attribute and the box2d-body will become a shadow. Only works for chain and polygon shape now.
@lucashicks1
Copy link

pls merge

@SimonIT
Copy link
Member

SimonIT commented Jan 2, 2024

Merged #124

@SimonIT SimonIT closed this Jan 2, 2024
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

Successfully merging this pull request may close these issues.

DirectionalLight extension for "top-down" view
3 participants