-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
What problem does this solve or what need does it fill?
It's common in many game engines to require projecting a custom texture over a scene. Common use cases are bullet decals, light cookies, and custom shadows. A visual example from Unity's documentation:

What solution would you like?
A Projector component that is able to alter the light intensity and color of a given light (light cookies), or alternatively project texture alterations (decals).
What alternative(s) have you considered?
Bake the decals into textures?
Additional context
This originally came from a Discord comment, replicated below:
[1:29 PM] james7132: How hard would it be to repurpose the shadow mapping code to allow for custom projections? i.e. non photorealistic shadows or decals?
[1:54 PM] cart: Hmm currently it would require a new set of extract/prepare/queue steps (but you could reuse the types). But if this is something we want to be extensible we could make that happen. We have options:
1. move the projection calculation to the extract step. This would enable you to write a new extract system that calculates the projection differently for you new light type, but extract into the same render type so it will get picked up in the Prepare and Queue steps
2. add a hook to the "app light type" that lets people configure a projection there
3. create a new extract and prepare system for the new type and adapt the existing prepare step to stop assuming its the only light prepare step
lain-dono, ggand0, SDesya74, muhuk, leopeltola and 8 more
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-FeatureA new feature, making something new possibleA new feature, making something new possibleD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!