Hello I would like to reproduce this without having the custom node except that I really have no idea how to do that. Can you help me please? thanks in advance
here the code :
static const float PI = 3.14159265359f;
int CDIndex = 13;
Steps = clamp(floor(Steps), 1, 128);
RadialSteps = clamp(floor(RadialSteps), 1, 128);
float StepSize = Radius/Steps; // Step size needed to get from the center to edge of the shape
float RadialStepSize = (PI2)/RadialSteps; // Step size needed to get around the object
float Result = 0.0f;
for (int i = 1; i <= Steps; i++){
float CurrentStep = i StepSize;
for(int j = 1; j < RadialSteps; j++) {
float Angle = j* RadialStepSize;
float2 Coord = float2(cos(Angle), sin(Angle)) * CurrentStep + UV;
float Sample = SceneTextureLookup(ViewportUVToSceneTextureUV(Coord, CDIndex), CDIndex, false);
Result += (MaxDistance - clamp(Sample, 0, MaxDistance)) / MaxDistance;
}
}
return float1 (Result / (RadialSteps * Steps));