uRaymarching

https://github.com/hecomi/uRaymarching

URP でなぜかライティングされない場合、 Rendering Path が Forward になってるか確認しよう

生成されたシェーダファイルの hlsl へのパスが相対なので毎回手直ししてるけどどうにかできないのか
Packages/com.hecomi.uraymarching/Runtime/Shaders/Include/UniversalRP/
生成したらその後は直接コードいじった方が楽かも

code:.hlsl
struct RaymarchInfo
{
// Input
float3 startPos;
float3 rayDir;
float3 polyPos;
float3 polyNormal;
float4 projPos;
float minDistance;
float maxDistance;
int maxLoop;
// Output
int loop;
float3 endPos;
float lastDistance;
float totalLength;
float depth;
float3 normal;
};

inline void PostEffect(RaymarchInfo ray, inout PostEffectOutput o) の PostEffectOutput は URP の SurfaceData 構造体のこと
シェーダ内に #define PostEffectOutput SurfaceData というマクロがあるから
code:.hlsl
struct SurfaceData
{
half3 albedo;
half3 specular;
half metallic;
half smoothness;
half3 normalTS;
half3 emission;
half occlusion;
half alpha;
half clearCoatMask;
half clearCoatSmoothness;
};