Sketchfab Forum

Difference between Nodes and Materials?

viewer-api
materials

(4535993) #1

Hi, just start to learn the 3d world , on the sketchfab model you can work with nodes or materials, and make for them similar operation like set a color or hide and show , but what are the differences between these two elements? When i must use one or the other ?


(Dark Minaz) #2

Hey there :slight_smile:
https://www.blender.org/manual/render/blender_render/materials/nodes/introduction.html
This should cover most of your questions

But short answer:
Materials = the final product
nodes = little inputs to the material

So a lot of nodes make up 1 material, or rather give the material additional inputs.

Hopes that helps a bit and welcome to the 3d world :slight_smile:


(4535993) #3

ty very much @dark_minaz , I feel a bit stupid after reading your link, it was quite intuitive


(Shaderbytes) #4

Sketchfab scene uses all sorts of "nodes" , they treat them more like entities with types. SO it is not only for materials as in blender

The viewer API has functions to retrieve the nodes or the materials individually.

You set colors and change textures on materials

You hide/show or translate nodes that have a "matrixtransform" type.

That is about it. While it is possible to perform hide and show on nodes with a different type , you cant move them for example.

You should check out my Viewer API Utility , it makes using the Viewer API easier and of coarse if you have coding skills you can look at the code as well.

I for example filter the nodes I list to the ones with a type of "matrixtransform" .. since they are the most useful. This filtered list will represent all the individual objects in the scene.

For Materials I retrieve the list individually as well


(4535993) #5

thanks you too @shaderbytes , big fan of your utility, this question was actually born to better understand how to make my models interact with your utility.


(Shaderbytes) #6

well the utility will log the nodes names in the console of the browser and it will log the material names. As mentioned the nodes list is a filtered list , so it represents all the objects in the scene and nothing more.

look at the example :

http://www.shaderbytes.co.za/sketchfab/development/api/examples/example_2.html

the dropdown list is the filtered list from the Utility .. notice it represents all object in the scene .. if you hide them all the scene will be empty.