Jump to content

Assigning my own material to a decal breaks the editor.


Pleca
 Share

Go to solution Solved by Josh,

Recommended Posts

Hi Josh, what is the current state of decals? When I try to assign my own material, the screen blinks black, and the viewports turn white. Additionally, when I run the game and turn towards a decal with my material, the game freezes. This is happening in a Lua Project; I haven't tried it in C++ yet.

 

Material:

Oil_stains.zip

Link to comment
Share on other sites

I think there is probably an error in the shader that is causing a texture read from a sampler from an invalid bindless pointer handle. That's what it means if you see a shader that causes all rendering to stop responding...

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

  • Solution

I don't understand why, but removing a small bit of code that was not needed anyways fixed the problem:

if (mtl.textureHandle[TEXTURE_METALLICROUGHNESS] != uvec2(0))
{
	vec4 mrsamp = texture(sampler2D(mtl.textureHandle[TEXTURE_METALLICROUGHNESS]), decalcoords);
	materialInfo.perceptualRoughness = materialInfo.perceptualRoughness * (1.0f - color.a) + mrsamp.y * color.a;
	materialInfo.metallic = materialInfo.metallic * (1.0f - color.a) + mrsamp.z * color.a;
}

 

  • Thanks 1

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