@MagnusWootton Do you have a team you work with or do you know how to create 3d game assets
Texture Mapping Issue on Rendering Volumetric Clouds
MagnusWootton said:
not all the code is there… i just see 3 dots, what about the rest of it, or is that the only bit?
the code from the ‘…’ below, works fine, if it doesnt it wont the produce the image on above comments, the code above from ‘…’, somehow produces the view from the bottom of the clouds. I wanna see them like this https://www.youtube.com/watch?v=s23wrmbtMWQ
float RaySphereIntersection(float3 RayOrigin, float3 RayDirection, float3 SphereOrigin, float Radius)
{
float t1, t0;
float3 L = SphereOrigin - RayOrigin;
float tCA = dot(L, RayDirection);
// if (tCA < 0) return -1;
float lenL = length(L);
float D2 = (lenL*lenL) - (tCA*tCA);
float Radius2 = (Radius*Radius);
if (D2<=Radius2)
{
float tHC = sqrt(Radius2 - D2);
t0 = tCA-tHC;
t1 = tCA+tHC;
}
else
return -1;
return t1;
}
Advertisement
Popular Topics
Advertisement