Author Topic: Glow & Specular Maps?  (Read 2803 times)

myles

  • Technician
  • ****
  • Posts: 113
    • View Profile
    • Myles Lambert's Portfolio
Glow & Specular Maps?
« on: 16 March 2008, 17:52:56 »
Hey All!
This is more direct to the glest coders and team but I was wondering if it is possible to implent a specular & glow map along with the diffuse map? How has the diffuse been implented? Is it a shader? You may know the glow map also by light map ;)

If we are using DirectX9 for the rendering then I found this little script, i dont know if it will work :/
Code: [Select]
// This example assumes that d3dDevice is a valid pointer to an
// IDirect3DDevice9 interface.
// lptexBaseTexture is a valid pointer to a texture.
// lptexSpecLightMap is a valid pointer to a texture that contains RGB
// specular light map data.
// lptexLightMap is a valid pointer to a texture that contains RGB
// light map data.

// Set the base texture.
d3dDevice->SetTexture(0, lptexBaseTexture );

// Set the base texture operation and arguments.
d3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE );
d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );

// Set the specular light map.
d3dDevice->SetTexture(1, lptexSpecLightMap);

// Set the specular light map operation and args.
d3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_ADD );
d3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT );

// Set the RGB light map.
d3dDevice->SetTexture(2, lptexLightMap);

// Set the RGB light map operation and arguments.
d3dDevice->SetTextureStageState(2,D3DTSS_COLOROP, D3DTOP_MODULATE);
d3dDevice->SetTextureStageState(2,D3DTSS_COLORARG1, D3DTA_TEXTURE );
d3dDevice->SetTextureStageState(2,D3DTSS_COLORARG2, D3DTA_CURRENT );
« Last Edit: 1 January 1970, 00:00:00 by myles »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #1 on: 17 March 2008, 15:55:11 »
Unfortunately, we are using the OpenGL fixed pipeline.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

myles

  • Technician
  • ****
  • Posts: 113
    • View Profile
    • Myles Lambert's Portfolio
(No subject)
« Reply #2 on: 17 March 2008, 16:48:43 »
Ahh, does OpenGL not support Specular/Glow?
Ive always thought it does :/
« Last Edit: 1 January 1970, 00:00:00 by myles »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #3 on: 18 March 2008, 10:26:17 »
Yeah, it does actually, even the fixed pipe, i didn't realize.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

myles

  • Technician
  • ****
  • Posts: 113
    • View Profile
    • Myles Lambert's Portfolio
(No subject)
« Reply #4 on: 18 March 2008, 17:47:42 »
Heh thats great, any chance of it being in the next version?
« Last Edit: 1 January 1970, 00:00:00 by myles »

martiño

  • Behemoth
  • *******
  • Posts: 1,095
    • View Profile
(No subject)
« Reply #5 on: 18 March 2008, 21:00:51 »
I don't really know, that would require changing the g3d format, to add a new texture, or at least a new flag for the meshes indicating that the alpha should be used as specular, seems a big change to me, maybe you can ask the guys that are making the GAP.
« Last Edit: 1 January 1970, 00:00:00 by martiño »

Duke

  • Guest
(No subject)
« Reply #6 on: 19 March 2008, 14:06:17 »
Well GAP has already got some features on it's list as well.
And while a graphics update would be nice, there are more important.
Like savegqames or multiplayer synchronisation.

If someone wants to work on the g3d format, it would be nice if he could consider animated textures as well.
« Last Edit: 1 January 1970, 00:00:00 by Duke »

myles

  • Technician
  • ****
  • Posts: 113
    • View Profile
    • Myles Lambert's Portfolio
(No subject)
« Reply #7 on: 20 March 2008, 16:19:26 »
I cant see animated textures being that great, apart from huge file sizes i cant see it would be very easy to implent.

As the glow and specular should follow the same UV map couldnt you simply have another TGA file like workerspec.tga and then in the xml have somthing like <specular value="workerspec.tga"/>

Wouldnt thatg work if coded?
« Last Edit: 1 January 1970, 00:00:00 by myles »

 

anything