Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Jan 31, 2019

Issue

#15666

New examples

label
https://rawgit.com/sunag/three.js/dev-fix-nameconflict/examples/webgl_materials_nodes.html?e=label

Description

  • fix Conflicting names for varying and temp var issue NodeMaterial: Conflicting names for varying and temp var. #15666
  • new setLabel and getLabel in TempNode
  • new internal var names:
    • nodeU0 = node uniform id
    • nodeV0 = node varying id
    • nodeT0 = node temp id
  • isShared, isUnique, isReadonly renamed to getShared, getUnique, getReadonly

Usages

label

var colorInput = new THREE.ColorNode( 0xFFFFFF ).setLabel( "colorInput" );
var specularInput = new THREE.FloatNode( .5 ).setLabel( "specularInput" );

var colorMix = new THREE.OperatorNode(
	colorInput,
	new THREE.ColorNode( 0x6495ED ).setReadonly( true ),
	THREE.OperatorNode.MUL
).setLabel("colorMix");

mtl.color = colorMix;
mtl.specular = specularInput;

optimization alerts
https://github.com/sunag/three.js/blob/40651f3fa6e6b12a2ae145cf3de14efde04065d3/examples/webgl_materials_nodes.html#L2543

https://github.com/sunag/three.js/blob/40651f3fa6e6b12a2ae145cf3de14efde04065d3/examples/webgl_materials_nodes.html#L2560

readonly

material.color = new THREE.ColorNode( 0xFFFFFF ).setReadonly( true );

@mrdoob mrdoob added this to the r101 milestone Jan 31, 2019
@mrdoob mrdoob merged commit 8dddb4e into mrdoob:dev Jan 31, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 31, 2019

Thanks!

@donmccurdy
Copy link
Collaborator

Works here, thanks! :)

@sunag sunag deleted the dev-fix-nameconflict branch June 3, 2019 22:56
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