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 intensity #4346

Merged
merged 7 commits into from
Jun 21, 2022
Merged

Shadow intensity #4346

merged 7 commits into from
Jun 21, 2022

Conversation

GSterbrant
Copy link
Contributor

@GSterbrant GSterbrant commented Jun 21, 2022

Supports spot, point/omni and directional lights.
Updated the lights.tsx example to add controls for the shadow intensities.
Shadow is calculated as a separate variable, and then 1 -> shadow is lerped with intensity value.

API changes:
Lights have a new member shadowIntensity.

Fixes #3604
Kapture 2022-06-21 at 13 49 31

Supports spot, omni and point lights.
Updated the lights.tsx to add controls for the shadow intensities.
Shadow is calculated as a separate variable, and then 1 -> shadow is lerped with intensity value.
Supports spot, omni and point lights.
Updated the lights.tsx to add controls for the shadow intensities.
Shadow is calculated as a separate variable, and then 1 -> shadow is lerped with intensity value.
…ngine into gsterbrant_shadow_intensity

# Conflicts:
#	src/framework/components/light/component.js
@GSterbrant
Copy link
Contributor Author

Realized I had this branched on an old version of main. Going to do a rebase and work this code in again.

@willeastcott
Copy link
Contributor

Very cool! So a few comments/suggestion:

  • Drop your username from the PR description
  • Consider adding an animated GIF to the PR description
  • When changing or adding new API, list those changes in the PR description

@GSterbrant GSterbrant changed the title Gsterbrant shadow intensity Shadow intensity Jun 21, 2022
@mvaligursky
Copy link
Contributor

Supports spot, omni and point lights.

omni = point?

Supports spot, omni and point lights.
Updated the lights.tsx to add controls for the shadow intensities.
Shadow is calculated as a separate variable, and then 1 -> shadow is lerped with intensity value.
Supports spot, omni and point lights.
Updated the lights.tsx to add controls for the shadow intensities.
Shadow is calculated as a separate variable, and then 1 -> shadow is lerped with intensity value.
…ngine into gsterbrant_shadow_intensity

# Conflicts:
#	src/framework/components/light/component.js
#	src/graphics/program-lib/programs/standard.js
Also removing the default setting for ambient bake lights.
Clustered lights needs more work, seeing as we use a parameter texture and will have to steal a slot from COOKIE_A to store the shadow intensity.
@slimbuck
Copy link
Member

This is awesome!

Please create an issue on editor repo so we don't forget to expose this functionality in the editor when engine is released.

@GSterbrant
Copy link
Contributor Author

playcanvas/editor#797

This issue relates to adding support for this in the editor.

@GSterbrant GSterbrant merged commit c605cf3 into main Jun 21, 2022
@GSterbrant GSterbrant deleted the gsterbrant_shadow_intensity branch June 21, 2022 15:53
@willeastcott
Copy link
Contributor

willeastcott commented Jun 21, 2022

@GSterbrant Ah, you probably need to add shadowIntensity here to ensure the TypeScript declarations are correct:

['shadowDistance', 'number'],

@GSterbrant GSterbrant self-assigned this Jun 23, 2022
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.

Add support for shadow strength
4 participants