#ifndef AC_RAYCAST_H #define AC_RAYCAST_H #include #include #include // Packed ellipsoids: center xyz, radii xyz, RGB, rock, glow, detail, bounds LRTB. // Uniforms: width,height,cx,cy,f,cos,sin, light xyz, right xyz, up xyz, // forward xyz, coarse cell, detail cell. Depth is full-resolution view-space Z. static inline double ac_ray_clamp(double x,double lo,double hi){return fmax(lo,fmin(hi,x));} static inline void ac_raycast(uint32_t *pixels,int stride,float *depth, const double *shapes,int count,const double *u){ const int w=(int)u[0],h=(int)u[1]; for(size_t i=0;i<(size_t)w*h;i++)depth[i]=INFINITY; for(int n=0;n