Game Development Community

Cubemap?

by Ted McClung · in Artist Corner · 12/10/2007 (1:33 pm) · 1 replies

Sorry in advance if this is a n00b question.

I'm trying to get a cubemap reflection to display on a player model. Here's my materials.cs file thus far:

new Material(Canopy)
{
BaseTex[0] = "~/data/vehicles/Player";
bumpTex[0] = "~/data/vehicles/bumpmap";
translucent = true;
translucentBlendOp = LerpAlpha;
translucentZWrite = true;
pixelSpecular[0] = true;
specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 30.0;
cubemap = "~/data/vehicles/test/test";


//cubemap = WChrome;
};

I noticed in another file someone used "Cubemap = WChrome;" and that worked. I found the WChrome pngs, so I know where they're stored, I'm just confused on how and where they're linked. If I wanted to link to my own image in that dir, how would I go about doing that?

#1
12/10/2007 (2:44 pm)
Ok, I figured it out. For people who were in the same position as I was, here's how you do it.

In ./client/scripts there's a file called commonMaterialData.cs. In here add this at the bottom:

new CubemapData( cubemapname )
{
cubeFace[0] = "~/data/textures/namexpos2";
cubeFace[1] = "~/data/textures/namexneg2";
cubeFace[2] = "~/data/textures/namezneg2";
cubeFace[3] = "~/data/textures/namezpos2";
cubeFace[4] = "~/data/textures/nameypos2";
cubeFace[5] = "~/data/textures/nameyneg2";
};

then paste this into the object's materials.cs datablock:

cubemap = cubemapname;

Have fun!