-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
renamed LibNode to NodeLib #7830
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,9 +96,11 @@ THREE.StandardNode.prototype.build = function( builder ) { | |
} | ||
else { | ||
|
||
// CubeMap blur effect (PBR) | ||
// autoblur textures for PBR Material effect | ||
|
||
builder.require.cubeTextureBias = builder.require.cubeTextureBias || new THREE.RoughnessToBlinnExponentNode(); | ||
var requires = { | ||
bias : new THREE.RoughnessToBlinnExponentNode() | ||
}; | ||
|
||
// verify all nodes to reuse generate codes | ||
|
||
|
@@ -116,7 +118,7 @@ THREE.StandardNode.prototype.build = function( builder ) { | |
if ( this.normal ) this.normal.verify( builder ); | ||
if ( this.normalScale && this.normal ) this.normalScale.verify( builder ); | ||
|
||
if ( this.environment ) this.environment.verify( builder.setCache( 'env' ) ); // isolate environment from others inputs ( see TextureNode, CubeTextureNode ) | ||
if ( this.environment ) this.environment.verify( builder, 'env', requires ); // isolate environment from others inputs ( see TextureNode, CubeTextureNode ) | ||
if ( this.reflectivity && this.environment ) this.reflectivity.verify( builder ); | ||
|
||
// build code | ||
|
@@ -135,7 +137,7 @@ THREE.StandardNode.prototype.build = function( builder ) { | |
var normal = this.normal ? this.normal.buildCode( builder, 'v3' ) : undefined; | ||
var normalScale = this.normalScale && this.normal ? this.normalScale.buildCode( builder, 'fv1' ) : undefined; | ||
|
||
var environment = this.environment ? this.environment.buildCode( builder.setCache( 'env' ), 'c' ) : undefined; | ||
var environment = this.environment ? this.environment.buildCode( builder, 'c', 'env', requires ) : undefined; | ||
var reflectivity = this.reflectivity && this.environment ? this.reflectivity.buildCode( builder, 'fv1' ) : undefined; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hmm, Yes! I'll update here so soon send another commit. |
||
|
||
material.requestAttrib.transparent = alpha != undefined; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
normalScale
should be avec2
, no?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @WestLangley. This would be a param equivalent of
texture2D( normalMap, vUv ).xyz
in https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl#L20There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sunag. Great work, BTW!
Sorry, I do not understand your reply... Maybe I am missing something, but what I was pointing out is
bumpScale
is univariate, butnormalScale
is bivariate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to run some tests. Really works but
normalmap
brings a scale value in .z which also affects thenormal
.I did a
vec2
refraction
with manual scale here: sunag@157b93ebut looking better the
textures
I have to put avec3
too.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Great PBR Material too 👍 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sunag Sorry, I do not think I am making myself clear. In your code:
scale
should be avec2
, and so shouldNormalMapNode.scale
, becauseMeshPhongMaterial.normalScale
is aVector2()
.In the examples,
normalScale
often must beVector2( 1, - 1 )
-- depending on how the normal map is encoded.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm,
normalScale
tovec2
looks nice, so soon send a update.