Skip to content

Promote Node-based Materials to Core and Polish #16440

@bhouston

Description

@bhouston
Description of the problem

@sunag did a great jobs on the node-based materials. While he got some criticism for his PRs when he was submitted them, usually dealing with internal design of the code compiler, I've always thought his work was amazing.

We have adopted node-materials for our rendering recently. We have found that it leads to more artistic creativity. It also leads to less complex code base -- the current Uber materials in Three.Js are just insanely complex and hard to maintain.

Thus I would propose that we move the node-based materials into core and then we slowly move most of the examples to use the node-based materials instead of the complex do-everything uber materials.

It is a big change, but I think it moves Three.JS forward.

Some of the changes I think are needed in order to make node-based materials first class citizens of Three.JS:

  • add ability to get specialized layers out of the node-based materials easily (normal, depth, velocity, etc.) There is both an easy way and a hard way to do this. We'll start with the easy way.
  • add more advanced options to the BRDF/EDFs such as anisotropy, basic sub-surface scattering.
  • add ability to read AO from a pre-pass in the BRDF/EDF so it can only affect indirect diffuse rather than being layered on top and add an example of this.
  • rework the texture node a bit, it has some problematic dependencies that make the graph difficult to evaluate. It was suggested by @jojobyte of NVIDIA to follow the model of UE4's texture node.
  • have a separate clearcoat normal: MeshPhysicalMaterial: clearcoat should not use underlying normal map #12867
  • add trilinear mapping example using the node-materials: Adding triplanar mapping #15048
  • add displacement map to the node-based BRDF/EDF (which would require a vertex shader change.)
  • add bump to normal example using the node-materials.
  • add transmission factor to the root BRDF/EDF and an example to three.js: Feature: Add transmissionFactor to Materials #15941
  • makes it easy to support arbitrary UV channels per map in a very simple way. Lots of power and flexibility. Thus negating the need for this: Support per-map per-Material UV channels, UV offset/repeat and texel scale/offset #8278
  • allows for supporting world to UV mapping and other forms of procedural UV transforms.

This ties into my current proposal to glTF to adopt node-based materials:

https://docs.google.com/document/d/1Y6JFE2FV164IFDe7_cYhp2gzhSapB76fUNPgmsI6DDY/edit

I am not the first to suggest this but I can not find the previous discussion. I think it is just a matter of time until this happens, so might as well do this now. No other JavaScript 3D renderer has fully node-based materials. ;)

/ping @WestLangley @donmccurdy

Three.js version
  • Dev
Browser
  • All of them
OS
  • All of them
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions