-
-
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
Conversation
|
@@ -131,7 +131,7 @@ THREE.PhongNode.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; |
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 a vec2
, 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#L20
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 @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, but normalScale
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.
Maybe I am missing something, but what I was pointing out is bumpScale is univariate, but normalScale is bivariate.
I had to run some tests. Really works but normalmap
brings a scale value in .z which also affects the normal
.
I did a vec2
refraction
with manual scale here: sunag@157b93e
but looking better the textures
I have to put a vec3
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.
Hi @sunag. Great work, BTW!
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:
"vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 map, vec2 mUv, float scale ) {",
scale
should be a vec2
, and so should NormalMapNode.scale
, because MeshPhongMaterial.normalScale
is a Vector2()
.
In the examples, normalScale
often must be Vector2( 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
to vec2
looks nice, so soon send a update.
Hi. I renamed
LibNode
toNodeLib
LibNode
is not aNode
is more like aShaderLib
.