Lines Matching refs:xvol

84     extvol *xvol;  in newextvol()  local
89 xvol = (extvol *)rt_getmem(sizeof(extvol)); in newextvol()
90 memset(xvol, 0, sizeof(extvol)); in newextvol()
92 xvol->methods = &extvol_methods; in newextvol()
94 xvol->min = min; in newextvol()
95 xvol->max = max; in newextvol()
96 xvol->evaluator = evaluator; in newextvol()
97 xvol->ambient = tex->ambient; in newextvol()
98 xvol->diffuse = tex->diffuse; in newextvol()
99 xvol->opacity = tex->opacity; in newextvol()
100 xvol->samples = samples; in newextvol()
102 xvol->tex = (texture *)rt_getmem(sizeof(texture)); in newextvol()
103 memset(xvol->tex, 0, sizeof(texture)); in newextvol()
105 xvol->tex->ctr.x = 0.0; in newextvol()
106 xvol->tex->ctr.y = 0.0; in newextvol()
107 xvol->tex->ctr.z = 0.0; in newextvol()
108 xvol->tex->rot = xvol->tex->ctr; in newextvol()
109 xvol->tex->scale = xvol->tex->ctr; in newextvol()
110 xvol->tex->uaxs = xvol->tex->ctr; in newextvol()
111 xvol->tex->vaxs = xvol->tex->ctr; in newextvol()
112 xvol->tex->islight = 0; in newextvol()
113 xvol->tex->shadowcast = 0; in newextvol()
115 xvol->tex->col = tex->col; in newextvol()
116 xvol->tex->ambient = 1.0; in newextvol()
117 xvol->tex->diffuse = 0.0; in newextvol()
118 xvol->tex->specular = 0.0; in newextvol()
119 xvol->tex->opacity = 1.0; in newextvol()
120 xvol->tex->img = nullptr; in newextvol()
121 xvol->tex->texfunc = (color(*)(void *, void *, void *))(ext_volume_texture); in newextvol()
122 xvol->tex->obj = (void *)xvol; /* XXX hack! */ in newextvol()
124 return xvol; in newextvol()
152 extvol *xvol; in ext_volume_texture() local
169 xvol = (extvol *)tex->obj; in ext_volume_texture()
243 tdist = xvol->samples; in ext_volume_texture()
245 tt = (xvol->opacity / tdist); in ext_volume_texture()
262 scalar = xvol->evaluator(pnt.x, pnt.y, pnt.z); in ext_volume_texture()
269 col.r += transval * col2.r * xvol->ambient; in ext_volume_texture()
270 col.g += transval * col2.g * xvol->ambient; in ext_volume_texture()
271 col.b += transval * col2.b * xvol->ambient; in ext_volume_texture()
276 if (xvol->diffuse > 0.0) { in ext_volume_texture()
278 N.x = (xvol->evaluator(pnt.x - ddt, pnt.y, pnt.z) - in ext_volume_texture()
279 xvol->evaluator(pnt.x + ddt, pnt.y, pnt.z)) * in ext_volume_texture()
282 N.y = (xvol->evaluator(pnt.x, pnt.y - ddt, pnt.z) - in ext_volume_texture()
283 xvol->evaluator(pnt.x, pnt.y + ddt, pnt.z)) * in ext_volume_texture()
286 N.z = (xvol->evaluator(pnt.x, pnt.y, pnt.z - ddt) - in ext_volume_texture()
287 xvol->evaluator(pnt.x, pnt.y, pnt.z + ddt)) * in ext_volume_texture()
311 col.r += col2.r * diffint.r * xvol->diffuse; in ext_volume_texture()
312 col.g += col2.g * diffint.g * xvol->diffuse; in ext_volume_texture()
313 col.b += col2.b * diffint.b * xvol->diffuse; in ext_volume_texture()