#1 2014-09-08 00:58:55

gaya
Member

Support for specular maps

It would be nice to have support for specular maps added to the engine. It's a pretty basic step in most artists workflow.

Offline

#2 2014-09-08 03:04:40

Nieb
Administrator

Re: Support for specular maps

There is support for color specular maps on world textures and gray scale specular maps on models.

Offline

#3 2014-09-08 03:56:55

gaya
Member

Re: Support for specular maps

How do you apply a specular map to a model? md5spec only accepts integers.

Offline

#4 2014-09-08 04:18:10

Nieb
Administrator

Re: Support for specular maps

md5spec/objspec/mdlspec is used to scale specularity, 100 being 100%.

The red channel of the masks file is used for specularity,
The green channel is for glow masking,
The blue channel is for envmap masking, the two numbers after "masks_name.png" are MAX MIN values for envmapping.

objskin MESH_NAME TEXTURE_NAME.png MASKS_NAME.png 0.4 0.1
objbumpmap MESH_NAME NORMALMAP_NAME.png

Check obj_cube for an example:
../Tesseract/media/model/mapmodel/obj_cube/

It's a bit convoluted, but that is the nature of the patch work development that cube engine 2 has gone through over the last 10 years.

Offline

#5 2014-09-08 12:20:39

gaya
Member

Re: Support for specular maps

So, all maps have to be compressed in the channels of a single map, called masks? What is envmap masking?

Last edited by gaya (2014-09-08 12:21:15)

Offline

#6 2014-09-08 13:15:15

Unnamed
Member

Re: Support for specular maps

An envmap consist of 6 textures (like a skybox). The reflexion of the envmap is drawn on the texture with a certain intensity.

Offline

#7 2014-09-08 18:53:24

gaya
Member

Re: Support for specular maps

And how can i add 6 textures into a single blue channel?

Offline

#8 2014-09-09 08:01:07

Unnamed
Member

Re: Support for specular maps

You have to use the textures from the media/sky directory.
You can also place envmap entities in your map that generates an envmap, but I think it is not used for models.

Offline

#9 2014-09-10 00:28:55

gaya
Member

Re: Support for specular maps

Ah, i guess now i get it. I should have a map on the blue channel which marks the areas affected by environment mapping on my model, correct? Same for glow and specularity, bu on green and red channels. How do i control "glowiness" strenght?

Offline

#10 2014-09-10 18:40:53

Calinou
Moderator

Re: Support for specular maps

Unnamed wrote:

You have to use the textures from the media/sky directory.
You can also place envmap entities in your map that generates an envmap, but I think it is not used for models.

It is used for models if the models don't specify an envmap texture. However, keep the amount of envmap entities low, else map loading time will be increased a lot.

Offline

Board footer