Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About the Setup #17

Open
RokuAce opened this issue Aug 21, 2023 · 2 comments
Open

About the Setup #17

RokuAce opened this issue Aug 21, 2023 · 2 comments

Comments

@RokuAce
Copy link

RokuAce commented Aug 21, 2023

Hi, thanks for providing this amazing tool. Unfortunately our team don't have much knowledge about HDRP and Shader, so I would like to know more regarding the setup.

What we'll like to do is when particles hits character's collider, it draws decal on mesh on where it hit.
It's different than what the tool was originally designed for. I guess what we have to do is:

  1. Make a special shader for the character. It has a AlbedoTexture for base color and a DecalColorMap Texture for Rendering Decal. In shader graph AlbedoTexture goes to BaseColor, but where is DecalColorMap Texture going to be plugged in?
    image

  2. Make a particle system, add a script so that when particle hits collider, it calls PaintDecal.instance.RenderDecal.

  3. We don't have to set up another camera for rendering.

Is our understanding correct? Please let us know. Thank you.
Regards.

@naelstrof
Copy link
Owner

Yeah you've got the setup and process 100% correct, besides maybe one thing. It's called _DecalColorMap with the underscore. You'll have to double check that it's actually referenced as that on the shader.

To answer where you're supposed to plug in the _DecalColorMap, you can do simple blending with the shader graph. Chances are that you could use the alpha channel of the _DecalColorMap as a lerp with the original color so it blends on top.

@naelstrof
Copy link
Owner

Now that I'm up I can show a screenshot. Here's a very basic shader setup:

image

Though you can get really really creative. For example, you could use _DecalColorMap as a mask to reveal a high-res repeating texture. Or use shader shenanigans to generate an infinite plane of noise, normals, and whatnot.

My favorite so far is to adjust the blending when rendering decals to make a sort of SDF-- Then use some smooth steps to define an "edge" of the decals. This allows it to pool up, and creates really blobby splats. However you need to understand the render pipeline pretty well to execute this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants