Game Development Community

Newbie- few questions about textures

by Krzysztof Szaton · in Technical Issues · 08/28/2008 (11:30 pm) · 4 replies

Hello.

I'm newbie in TGEA. I was using different engine to yesterday. I read documentation but i still have questons.

- Materials and CustomMaterials- where is difference? CustomMaterials use shaders and Materials don't?
- How specular works? In old engine we have 'spacular texture'. In Materials I don't see this texture. If i have a box shape(half made with metal and half with wood) how can I define which part is more shiny?
- Can I scale texture (base, normal..) in Materials when i don't need to Wave texture?
- If i have my example shape(half with metal and half with wood) how i should make detail texture? Use metal or wood?
- How can i fast see models and my textures i TGEA? Now i must run project, add model etc. I have show tool but materials don't work. I made model(box.dts) with diffuse texture "color.jpg". I exported it and created box.cs.

----------------------

new Material(textbox)
{
mapTo = box;
baseTex[0] = "color2";
};
--------------------------

If i open this model in STP i see model whit texture "color".(i't should be color2 right?) What is wrong?

- I have my box. Materials have stages. Can i use them to texture box half with metal and half with wood?


Answers will _really_ helps me. Thank You for your help! It's a pity that sample objects in TGEA are very simple.

#1
08/29/2008 (10:11 am)
ShowTool is based on the TGE codebase and does not support shader technology, so that is why you are seeing the original texture and not your "color2" definitions.
#2
08/29/2008 (10:39 am)
For better use this

new Material(box)
{
mapTo = "box";
basetex[0] = "color2"; // base texture
bumptex[0] = "color2.n"; // filter tecture (.n or .normal)

//cubemap = light; // or chromium or gold ... as you like

pixelSpecular[0] = true; //true or false
specular[0] = "0.3 0.3 0.3 0.3"; // R G B level
specularPower[0] = 32.0; // Volume of power effect < 32 = more intense (2 ^x)
};

here is the type for a cube

new CubemapData(light)
{
cubeFace[0] = "light_side_01"; // light_side_01.png, jpg ...... is 1 of the 6 sides of a cube
cubeFace[1] = "light_side_02";
cubeFace[2] = "light_side_03";
cubeFace[3] = "light_side_04";
cubeFace[4] = "light_side_05";
cubeFace[5] = "light_side_06";
};
#3
08/29/2008 (11:25 am)
1. Difference between Materials and CustomMaterials:
Quote:Custom Materials

Materials offer a lot of options for surface properties, but if even more control is desired, CustomMaterials can be used. CustomMaterials allow the user to specify their own shaders via the ShaderData datablock.
CustomMaterial Properties

CustomMaterials are derived from Materials, so they can hold a lot of the same properties, but it is up to the user to code how these properties are used.
(Source - Old Docs)

2. How to define specular:
Quote:
This value indicates what color the specular highlights on a material should be. Usually this is the same color as the light source that is lighting the material. Specular is additively applied to materials, so this value can also be used to control the intensity of the specular highlight. The darker the color, the less intense the highlight.
Script reference: specular = color
(Source - New Documentation)

The rest are more how-tos, which isn't my particular area of expertise. There are some other docs and tutorials out there, though. Have a browse through the forums and official docs for more.
#4
08/29/2008 (11:28 am)
Thank You for reply. This resolves my 'problem' with ST:) Dimitris- Your material looks really nice. Thank You. I will read some older post Michael - thanks!