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

add subtractBox option #47

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

Algorush
Copy link
Contributor

Hi @Avnerus!
We at 3DStreet would be glad to get your advice on the best way to solve another important task for us.
I'm trying to add a subtractBox selector attribute to component so that the content of tiles intersected with that Box will not be drawn. I'm trying to do this using shaders for now. This approach works on a simple example with two boxes or other objects.
The question is how to add shaders to the tiles material in the right way. I discovered the shaderCallback function in three-loader-3diles options. I use it to add shaders to the tiles material using material.onBeforeCompile. I get this strange result in the screenshot. The white box is the clipping area.
image

  • It looks like somewhere transformations are applied to tiles that give this result.
  • It looks like the tiles are cloned and the fragmentShader is applied to all instances.
  • The uniforms parameters are not updated for the material.
  • Textures look darker.

Will be great if you give some advices about this task!

@Algorush Algorush requested a review from Avnerus as a code owner April 12, 2024 21:21
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.

None yet

1 participant