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

feat: add reflector #136

Merged
merged 20 commits into from
Nov 14, 2023
Merged

feat: add reflector #136

merged 20 commits into from
Nov 14, 2023

Conversation

JaimeTorrealba
Copy link
Member

@JaimeTorrealba JaimeTorrealba commented Jul 17, 2023

No description provided.

@JaimeTorrealba JaimeTorrealba self-assigned this Jul 17, 2023
@netlify
Copy link

netlify bot commented Jul 17, 2023

Deploy Preview for cientos-tresjs ready!

Name Link
🔨 Latest commit 994d35e
🔍 Latest deploy log https://app.netlify.com/sites/cientos-tresjs/deploys/6553b92401a0df0008aa35db
😎 Deploy Preview https://deploy-preview-136--cientos-tresjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@JaimeTorrealba JaimeTorrealba marked this pull request as draft July 17, 2023 23:17
@JaimeTorrealba JaimeTorrealba marked this pull request as ready for review July 18, 2023 15:34
Copy link
Member

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JaimeTorrealba excellent job, I love the result.

I think we should add this to abstractions instead of materials because this implementation actually doesn't solve #5, it's not a Material but I see it as a handy abstraction from 'three/addons/objects/Reflector'

The #5 is an actual material, to be used like this:

<TresMesh >
      <TresPlaneGeometry />
      <MeshReflectorMaterial blur="[300, 100]" resolution="2048" />
</TresMesh>

Another question would be, how are you handling the reactivity of those props?

@alvarosabu
Copy link
Member

alvarosabu commented Jul 19, 2023

Docs build is broken, can you check the build locally?
Uploading Screenshot 2023-07-19 at 11.06.57.png…

@JaimeTorrealba
Copy link
Member Author

@alvarosabu could be related to this doc's problem #137

@JaimeTorrealba
Copy link
Member Author

In relation to the other comment, You're right is not a material, I'll move it, but It solves the exact same problem of the #5.
Are you sure you don't want to close it?? I mean obviously need some changes in the shaders but the effect you can achieve is the same

As the properties are in the args (And because of the way the Reflector class have been built in, I couldn't figure out how to make reactive props) only the color is reactive

@alvarosabu
Copy link
Member

For the ticket leave it open, the idea would be to eventually create te reflector material.

For the reactivity I give you a small clue since you can get the reference of the instance, if one of the argument changes (watch) you could potentially dispose it and re initialize it with the new args.

Give it a though 😉

@JaimeTorrealba
Copy link
Member Author

I tried already but nothing work, nor dispose the material, geometry.

Nothing works, I Guess I am doing something wrong :(

@alvarosabu
Copy link
Member

@JaimeTorrealba can you merge latest main and update this PR, it has been around for long

@JaimeTorrealba
Copy link
Member Author

@alvarosabu I already merge main in this one.

Is not ready yet for merging to main, because is not reactive, when you have some time check it please. If you have any doubts, please let me know.

@alvarosabu alvarosabu marked this pull request as draft August 22, 2023 15:59
@JaimeTorrealba JaimeTorrealba marked this pull request as ready for review September 26, 2023 14:49
Copy link
Contributor

@andretchen0 andretchen0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Here are my suggestions.

Copy link
Contributor

@andretchen0 andretchen0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Member

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JaimeTorrealba awesome to see this updated, can you add a demo to the documentation, this one is especially visual, it would be nice.

Copy link
Member

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaimeTorrealba Thanks for this, looks amazing, great job

@alvarosabu alvarosabu merged commit bd4d710 into main Nov 14, 2023
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.

3 participants