Tetzlaff@Posted: Thu Apr 03, 2008 12:56 pm :
I made some marble textures and want to add a cube map to the material, so that the result will look like polished, reflecting marble. It doesn´t have to be actual reflections, just faked ones like on many of the stock Doom3 glass textures.

Here is my current material file:

Code:
textures/gothblock/marmor_grn1
{
   qer_editorimage textures/gothblock/marmor_grn1_d.tga

   diffusemap   textures/gothblock/marmor_grn1_d.tga
   specularmap     textures/gothblock/marmor_grn1_s.tga
        bumpmap    textures/gothblock/marmor_grn1_n.tga
       
}


How do I add a cube map to this?



BloodRayne@Posted: Thu Apr 03, 2008 1:21 pm :
Code:
{
   blend        add             // this stage is an additive blend
   cubeMap      env/metal       // this stage uses the files named "metal_xx.tga"
   texgen       reflect         // this cubemap will be reflected
}


You can play with the 'blend' modes for different effects. For more information: viewtopic.php?t=17762



Tetzlaff@Posted: Thu Apr 03, 2008 1:37 pm :
Thanks! I added that whole bracket in between the brackets of my material, looked at one of the glass materials for reference and it works great.

Now I only have to create a new cubemap that doesn´t look so techy, because I want to use the textures in a medieval/hellish setting. I also have to take a look what those blend functions you mention do exactly.



LDAsh@Posted: Thu Apr 03, 2008 4:56 pm :
Unfortunately Doom3 can't do light-friendly cubemap reflections (to the best of my knowledge) so they all glow-in-the-dark and not very suitable for textures that get widely used. This and distance-portals are one of the main reasons I switched to Quake 4, shiny foggy outdoor areas with detail. I mentioned in that other thread that it just requires a different blend mode, but that's a false statement. It applies to Quake 4 and not Doom3, same with distance-portals. Could probably be easily ported(stolen) though, I guess.



aphexjh@Posted: Thu Apr 03, 2008 9:19 pm :
I was making pilars just a little while ago, and wanted a shiny cubemapped granite texture. So i used one of the granite countertop textures from textures/objects and a cubemap glass texture. then i made two cylinders, one with the granite texture and a slightly bigger one with the glass texture. Then i just put them together, and it looks ok. A little cheap, but effective.
Image



BloodRayne@Posted: Fri Apr 04, 2008 9:43 am :
LDAsh wrote:
Unfortunately Doom3 can't do light-friendly cubemap reflections (to the best of my knowledge) so they all glow-in-the-dark and not very suitable for textures that get widely used. This and distance-portals are one of the main reasons I switched to Quake 4, shiny foggy outdoor areas with detail. I mentioned in that other thread that it just requires a different blend mode, but that's a false statement. It applies to Quake 4 and not Doom3, same with distance-portals. Could probably be easily ported(stolen) though, I guess.


Nonsense. You can use several blend modes to make them non-additive.



LDAsh@Posted: Fri Apr 04, 2008 12:29 pm :
Great! So what's that blend?
I've spent countless hours going through all combinations and trying all tricks I could find, and never found a light-friendly cubemap technique in Doom3, and judging by the glow-in-the-dark Z-Sec visors, I just assumed id Software never implemented it.
In Quake 4 it's "blend gl_dst_color,gl_one" and that looks great, can't see it in pitch-black at all, but in Doom3 this same setup makes the cubemap invisible, it just doesn't work. So it would be great to know your trick. ;)



BloodRayne@Posted: Fri Apr 04, 2008 2:15 pm :
LDAsh wrote:
Great! So what's that blend?
I've spent countless hours going through all combinations and trying all tricks I could find, and never found a light-friendly cubemap technique in Doom3, and judging by the glow-in-the-dark Z-Sec visors, I just assumed id Software never implemented it.
In Quake 4 it's "blend gl_dst_color,gl_one" and that looks great, can't see it in pitch-black at all, but in Doom3 this same setup makes the cubemap invisible, it just doesn't work. So it would be great to know your trick. ;)

I am at work now but will post it when I get home.



Tetzlaff@Posted: Fri Apr 04, 2008 3:14 pm :
Yes, that would be interesting. For my current level it would work as well with that unwanted "glow in the dark" because the level is well lit, but it would be of course better without it.



BloodRayne@Posted: Fri Apr 04, 2008 10:13 pm :
The blend mode I use is this:
Code:
models/hexen/menu/edgelogo {
   //deform   particle   hexen_menu_blood
   
   {
      blend   diffusemap   
      map   models/hexen/mapmodels/static/barrel/barrel_iron_d.tga

      
   }
   specularmap   models/hexen/mapmodels/static/barrel/barrel_iron_s.tga
        bumpmap   heightmap (models/hexen/mapmodels/static/barrel/barrel_iron_d.tga, 2)
   {
            blend       gl_dst_color, gl_one
           cubeMap    env/gen2
      texgen     reflect
       }

}

And it's not additive, and it works in doom3 as well. :wink:

The serpent staff in this image uses this as well:
Image



Tetzlaff@Posted: Sat Apr 05, 2008 8:55 am :
Works perfect! Many thanks!

BTW, that Hexen Edge of Chaos shot looks awsome.



LDAsh@Posted: Sat Apr 05, 2008 1:51 pm :
Awesome, it works! I swear on my life this same material didn't work for me before, maybe pre 1.3 point release, and maybe just on my Radeon9700, but earlier I had bright green and purple checkerboard test images and couldn't see a thing using that blend. I guess it really was broken before otherwise of course id Software would have done theirs differently, maybe there's still a chance it's broken on some hardwares? Who knows. I'll have to update my mod. Happy to stand corrected. :)



Tetzlaff@Posted: Thu Apr 03, 2008 12:56 pm :
I made some marble textures and want to add a cube map to the material, so that the result will look like polished, reflecting marble. It doesn´t have to be actual reflections, just faked ones like on many of the stock Doom3 glass textures.

Here is my current material file:

Code:
textures/gothblock/marmor_grn1
{
   qer_editorimage textures/gothblock/marmor_grn1_d.tga

   diffusemap   textures/gothblock/marmor_grn1_d.tga
   specularmap     textures/gothblock/marmor_grn1_s.tga
        bumpmap    textures/gothblock/marmor_grn1_n.tga
       
}


How do I add a cube map to this?



BloodRayne@Posted: Thu Apr 03, 2008 1:21 pm :
Code:
{
   blend        add             // this stage is an additive blend
   cubeMap      env/metal       // this stage uses the files named "metal_xx.tga"
   texgen       reflect         // this cubemap will be reflected
}


You can play with the 'blend' modes for different effects. For more information: viewtopic.php?t=17762



Tetzlaff@Posted: Thu Apr 03, 2008 1:37 pm :
Thanks! I added that whole bracket in between the brackets of my material, looked at one of the glass materials for reference and it works great.

Now I only have to create a new cubemap that doesn´t look so techy, because I want to use the textures in a medieval/hellish setting. I also have to take a look what those blend functions you mention do exactly.



LDAsh@Posted: Thu Apr 03, 2008 4:56 pm :
Unfortunately Doom3 can't do light-friendly cubemap reflections (to the best of my knowledge) so they all glow-in-the-dark and not very suitable for textures that get widely used. This and distance-portals are one of the main reasons I switched to Quake 4, shiny foggy outdoor areas with detail. I mentioned in that other thread that it just requires a different blend mode, but that's a false statement. It applies to Quake 4 and not Doom3, same with distance-portals. Could probably be easily ported(stolen) though, I guess.



aphexjh@Posted: Thu Apr 03, 2008 9:19 pm :
I was making pilars just a little while ago, and wanted a shiny cubemapped granite texture. So i used one of the granite countertop textures from textures/objects and a cubemap glass texture. then i made two cylinders, one with the granite texture and a slightly bigger one with the glass texture. Then i just put them together, and it looks ok. A little cheap, but effective.
Image



BloodRayne@Posted: Fri Apr 04, 2008 9:43 am :
LDAsh wrote:
Unfortunately Doom3 can't do light-friendly cubemap reflections (to the best of my knowledge) so they all glow-in-the-dark and not very suitable for textures that get widely used. This and distance-portals are one of the main reasons I switched to Quake 4, shiny foggy outdoor areas with detail. I mentioned in that other thread that it just requires a different blend mode, but that's a false statement. It applies to Quake 4 and not Doom3, same with distance-portals. Could probably be easily ported(stolen) though, I guess.


Nonsense. You can use several blend modes to make them non-additive.



LDAsh@Posted: Fri Apr 04, 2008 12:29 pm :
Great! So what's that blend?
I've spent countless hours going through all combinations and trying all tricks I could find, and never found a light-friendly cubemap technique in Doom3, and judging by the glow-in-the-dark Z-Sec visors, I just assumed id Software never implemented it.
In Quake 4 it's "blend gl_dst_color,gl_one" and that looks great, can't see it in pitch-black at all, but in Doom3 this same setup makes the cubemap invisible, it just doesn't work. So it would be great to know your trick. ;)



BloodRayne@Posted: Fri Apr 04, 2008 2:15 pm :
LDAsh wrote:
Great! So what's that blend?
I've spent countless hours going through all combinations and trying all tricks I could find, and never found a light-friendly cubemap technique in Doom3, and judging by the glow-in-the-dark Z-Sec visors, I just assumed id Software never implemented it.
In Quake 4 it's "blend gl_dst_color,gl_one" and that looks great, can't see it in pitch-black at all, but in Doom3 this same setup makes the cubemap invisible, it just doesn't work. So it would be great to know your trick. ;)

I am at work now but will post it when I get home.



Tetzlaff@Posted: Fri Apr 04, 2008 3:14 pm :
Yes, that would be interesting. For my current level it would work as well with that unwanted "glow in the dark" because the level is well lit, but it would be of course better without it.



BloodRayne@Posted: Fri Apr 04, 2008 10:13 pm :
The blend mode I use is this:
Code:
models/hexen/menu/edgelogo {
   //deform   particle   hexen_menu_blood
   
   {
      blend   diffusemap   
      map   models/hexen/mapmodels/static/barrel/barrel_iron_d.tga

      
   }
   specularmap   models/hexen/mapmodels/static/barrel/barrel_iron_s.tga
        bumpmap   heightmap (models/hexen/mapmodels/static/barrel/barrel_iron_d.tga, 2)
   {
            blend       gl_dst_color, gl_one
           cubeMap    env/gen2
      texgen     reflect
       }

}

And it's not additive, and it works in doom3 as well. :wink:

The serpent staff in this image uses this as well:
Image



Tetzlaff@Posted: Sat Apr 05, 2008 8:55 am :
Works perfect! Many thanks!

BTW, that Hexen Edge of Chaos shot looks awsome.



LDAsh@Posted: Sat Apr 05, 2008 1:51 pm :
Awesome, it works! I swear on my life this same material didn't work for me before, maybe pre 1.3 point release, and maybe just on my Radeon9700, but earlier I had bright green and purple checkerboard test images and couldn't see a thing using that blend. I guess it really was broken before otherwise of course id Software would have done theirs differently, maybe there's still a chance it's broken on some hardwares? Who knows. I'll have to update my mod. Happy to stand corrected. :)