THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/03/2003 at 06:18, xxxxxxxx wrote:
Just enter this sample script into a file named "volume.cof" inside your "plugins" folder:
var PLUGIN_ID = 1011472; // Unique ID
class VolumeExample : VolumePlugin
{
public:
VolumeExample();
GetName();
GetID();
GetInfo(settings);
FillInfoData(settings,is);
CalcSurface(settings,render,vd);
};
VolumeExample::VolumeExample() { super(); }
VolumeExample::GetName() { return "Volume Example"; }
VolumeExample::GetID() { return PLUGIN_ID; }
VolumeExample::GetInfo(settings) { return SHADER_SOFTSHADOW|SHADER_MIPSAT; }
VolumeExample::CalcSurface(settings, render, vd)
{
var f = 2*vd->p.z*vd->p.z - vd->p.x*vd->p.x - vd->p.y*vd->p.y;
if (f < -1000)
{
vd->col = vector(1,0,0);
}
else if (f > 1000)
{
vd->col = vector(0,1,0);
}
else
{
vd->col = vector(0,0,0);
}
}
VolumeExample::FillInfoData(settings,is)
{
is->midcol = vector(0,0,0); // Preview color
is->midtrans = vector(0,0,0);
is->midrefl = vector(0,0,0);
}
main()
{
Register(VolumeExample);
}