I wana convert multi-pass shadertoy project to hsls,custom node, but I meet some qustions.
This shader used buffer which output float4 color to the pixel shader, and pixel shader convert it to a texture.Code like this:
In the buffer file:
// Normalized pixel coordinates (from 0 to 1)
float2 uv = fragCoord/iResolution.xy;
// Time varying pixel color
float3 col = 0.5 + 0.5*cos(iTime+uv.xyx+float3(0,0,4));
// Output to screen
return float4(col,1.0);
In the pixel shader:
float2 uv = fragCoord.xy / iResolution.xy;
float4 col = texture(iChannel0, uv);
return float4(col.rgb, 1.);
iChannel0 is the input value from buffer’s return.
The problem is how can I convert float4 to texture? It seems that UE4 doesnt support create new texture in one custom node? Or maybe should I create a texture sampler node outside? But the same problem is how convert float4 to a texture in a texture sample node.