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

New WebGLNodeBuilder + Nodes: transmission #24453

Merged
merged 7 commits into from
Aug 12, 2022

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Aug 5, 2022

Related issue: #24385

Description

Part 4 / 4

I rewrote the Slots API and I added transmission*Node and specular*Node, iorNode.
Now WebGLNodeBuilder can detect the precedence of the slots and added the code/snippet always in the correct sequence.

This contribution is funded by Google via Igalia

@sunag sunag added this to the r144 milestone Aug 5, 2022
@sunag sunag mentioned this pull request Aug 5, 2022
8 tasks
@mrdoob
Copy link
Owner

mrdoob commented Aug 5, 2022

Is that output correct?

@sunag
Copy link
Collaborator Author

sunag commented Aug 5, 2022

Is that output correct?

Yees! hehe 😁 I put a normalWorld in colorNode... do you think I should remove it?

const nodeMaterial = NodeMaterial.fromMaterial( material );
nodeMaterial.colorNode = normalWorld;
nodeMaterial.transmissionNode = normalWorld.y;

@mrdoob
Copy link
Owner

mrdoob commented Aug 9, 2022

Yees! hehe 😁 I put a normalWorld in colorNode... do you think I should remove it?

Yeah, it looks like it's broken otherwise 😅

@sunag
Copy link
Collaborator Author

sunag commented Aug 9, 2022

Yeah, it looks like it's broken otherwise 😅

Ok, done!!

const checkerNode = checker( mul( add( uv(), vec2( 0, timerLocal( - .05 ) ) ), 7 ) );

const nodeMaterial = NodeMaterial.fromMaterial( material );
nodeMaterial.transmissionNode = float( 1 );
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can write just 1 and 1.5 without any float().

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that no! This can't support primitive values here, just Node classes.

@mrdoob
Copy link
Owner

mrdoob commented Aug 10, 2022

image

Still looks broken, in a different way now 😇

@sunag
Copy link
Collaborator Author

sunag commented Aug 10, 2022

Updated :)

@mrdoob mrdoob merged commit 2f584eb into mrdoob:dev Aug 12, 2022
@mrdoob
Copy link
Owner

mrdoob commented Aug 12, 2022

Thanks!

@sunag sunag deleted the dev-transmission-nodes branch August 12, 2022 05:06
@joshuaellis joshuaellis mentioned this pull request Aug 17, 2022
3 tasks
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* Cache CheckerNode if necessary

* Nodes: Refactor, ior, specular, transmission nodes

* update example

* add transmission example

* update transmission

* update transmission (2)

* update screenshot
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
* Cache CheckerNode if necessary

* Nodes: Refactor, ior, specular, transmission nodes

* update example

* add transmission example

* update transmission

* update transmission (2)

* update screenshot
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