Jump to content

Material Slots


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

Ah okay.  I am curious though how to pass multiple textures to the shader for terrain... is there like a 2D texture array slot or something or we just set it just like Leadwerks;

Obviously I can manipulate the shader to read from the appropriate slots.

slot0 : DIFFUSE1
slot1 : NORMAL1
slot2 : DIFFUSE2
slot3 : NORMAL2
slot4 : DIFFUSE3
slot4 : NORMAL3
etc...
Link to comment
Share on other sites

Yeah, there was documentation on the material format but it was years ago. I recall there being features like texture scrolling and such in the default shaders too but I'm not sure if they still are implemented.

Hopefully this gets cleaned up and documented in the near future.

  • Upvote 1

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

  • Solution

Let's keep it simple. Here is a valid material file:

{
	"material": {
		"color": [1.0, 1.0, 1.0, 1.0],
		"displacement": 0.1,
		"emission": [0.0, 0.0, 0.0],
		"metallic": 0.0,
		"roughness": 1.0,
		"shaderFamily": "Shaders/PBR.json",
		"shadow": true,
		"tessellation": false,
		"texture0": "./defaultmeshface.tex",
		"transparent": false
	}
}

For textures, a file in the same folder as the material file can use a relative path by adding ./ at the beginning of the path. Otherwise it will be considered a path relative to the project folder, i.e. "Materials/brick/brick01.dds".

  • Like 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...