Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Jan 16, 2020

Basically this turns WebGLRenderer more flexible and this too is a simplification of uniforms update.

Result for tests:
https://raw.githack.com/sunag/three.js/dev-uniformsupdate-test/examples/index.html?q=material

Related:
#18162
#18175
#18068

@Mugen87 Mugen87 changed the title Procedural uniforms update WebGLRenderer: Procedural uniforms update. Jan 16, 2020
@sunag
Copy link
Collaborator Author

sunag commented Jan 16, 2020

All refresh material uniforms functions: refreshUniformsCommon, refreshUniformsLambert, refreshUniformsToon, refreshUniformsPhong, refreshUniformsPhysical... is replaced to refreshUniforms:

https://github.com/sunag/three.js/blob/757b052cd34e4a89418200bc8f6f73ba409822f8/src/renderers/WebGLRenderer.js#L1944-L1972

Properties identical in material and uniform are updated automatically.

In special cases, like diffuse or envMap is possible use .onUpdate to a customized update.
Uniform.onUpdate ( uniforms, material, renderer, scene )

Note that there has been a reduction in the amount of code, that would be even bigger if there were more materials.

NodeMaterial update like #18162 became possible.

/ping @mrdoob @WestLangley @bhouston @donmccurdy @Mugen87

@sunag sunag marked this pull request as ready for review January 16, 2020 17:42
@WestLangley
Copy link
Collaborator

Everything appears to be working in my test cases so far...

@taphos
Copy link
Contributor

taphos commented May 4, 2020

@sunag is this ticket abandoned?

@sunag
Copy link
Collaborator Author

sunag commented Mar 29, 2021

With MaterialNode and new fields in materials for nodes like material.colorNode I think that we need not work more at this point for now.
#21322

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.

4 participants