Jump to content

GLTF not loading custom vertex shader


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

This is an odd one but I believe I have found the issue with it.

If you load the gltf in the model editor, navigate to one of the meshes (first mesh in the list I think, but doesn't really matter) and browse for the 'Leaves' material.  The leaves should go red, and while the editor updates the leaves should move around a bit.

However, if the material that you apply (Leaves.mat in this case) has 'alphamask' set as true, the flag 'alphaMode' in the GLTF will be set to 'MASK' and not 'BLEND'.  If 'alphaMode' is set to MASK the custom vertex shader in 'leaves.mat' which turns the leaves red and moves them, doesn't seem to load.  If you manually change this back to BLEND and reload the model, the leaves should be red and move a bit as the window updates.

Please let me know if I missed anything from the zip.  You may need to change a few file paths in the material / shader family.

PineTree.zip

  • Thanks 1
Link to comment
Share on other sites

  • Solution

The shader family needs a separate set of options for when alpha masking is active. Does this solve your problem?

{
	"shaderfamily":
	{
		"root":"Shaders/PBR.fam",
		"static":
		{
			"float":
			{
				"opaque":
				{
					"default":
					{
						"base":
						{
							"vertex":"Foliage/PineTree/Leaves.vert.spv"
						},
						"depthPass":
						{
						}
					}
				},
				"mask":
				{
					"default":
					{
						"base":
						{
							"vertex":"Foliage/PineTree/Leaves.vert.spv"
						},
						"depthPass":
						{
						}
					}
				}
			}
		}
	}
}

 

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...