simplestargame / SimpleURPToonLitOutlineExample

SimpleURPToonLitOutlineExample
MIT License
166 stars 23 forks source link

Is it possible to convert this shader into a standard shader graph? #3

Open ReForge-Mode opened 1 year ago

ReForge-Mode commented 1 year ago

Since shader graph is now supported for non-URP project, I've been trying to convert this URP shader into a non-URP shader graph. But I keep encountering error with the custom node in the shader graph.

Before I proceed even further, is it even possible to have this shader as a shader graph for non-URP project?

simplestargame commented 1 year ago

Assets\SimplestarGame\SimpleURPToonLitOutlineExample\Resources\Unity-Technologies\ShaderGraph-Custom-Lighting\Includes\CustomLighting.hlsl

#ifndef CUSTOM_LIGHTING_INCLUDED
#define CUSTOM_LIGHTING_INCLUDED

#define SHADERGRAPH_PREVIEW // added line

void MainLight_float(float3 WorldPos, out float3 Direction, out float3 Color, out float DistanceAtten, out float ShadowAtten)

I was able to resolve the build error, but I will not support it until Built-in since it has been built for URP.

ReForge-Mode commented 1 year ago

I see. I'm not too familiar with shader programming. I'm more of a shader graph guy. So this should be a good challenge for me to take.

Would you mind if I ask a thing or two if I found some errors along the way?

simplestargame commented 1 year ago

It is my understanding that there is indeed shader code that works with both... but the shader code in this repository will not work without a drastic fix. I think it is a difficult task to tackle.

I am not sure I can answer your question.