Page 1 of 1

[SOLVED] Shiny surface of windows

Posted: Thu Sep 01, 2011 10:29 am
by MajkiFajki
This is question related to old discussions:
http://custommapmakers.net/index.php?op ... id=54#2048
http://custommapmakers.net/index.php?op ... id=54#1700

I can do what I want, but the main problem is reflection intensity. I have tried two q3map_surfacelight values:
400:
Image

and 800:
Image

Reflection image is this:
Image


I tried other - even completely black image. Still heavy-reflection.


Is there something in sky shader, that is responsible for that?

I have tried two shaders:

Code: Select all

textures/ut4_poland/chmury1niebo
{
   surfaceparm noimpact
   surfaceparm nolightmap
   surfaceparm sky
   q3map_surfacelight 400
   q3map_lightRGB 255 255 255
   qer_editorimage textures/ut4_poland/chmury1niebo.jpg
    skyparms - 512 -
   {
      map textures/ut4_poland/chmury1niebo.jpg
      tcMod scale 3 3 //4 4
      tcMod scroll 0.0200 0.00200
   }
}


And:

Code: Select all

textures/ut4_poland/polniebo1
{
qer_editorimage textures/ut4_poland/polniebo1.jpg
surfaceparm noimpact
surfaceparm nolightmap
surfaceparm sky
q3map_sun 255 255 209 500 130 55
q3map_lightRGB 255 255 209
q3map_surfacelight 275
    q3map_backsplash 0 0
    skyparms - 512 -
   {
      map textures/ut4_poland/polniebo1.jpg
      tcMod scale 3 3 //4 4
      tcMod scroll 0.0200 0.00200
   }
}


No difference. I want to have bright, sunny day and slight reflection on windows. How can I achieve that?

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 11:13 am
by Rayne
rgbGen const ( 0.2 0.2 0.2) in the glass shader, more precisely in the stage that adds the reflection image.

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 11:51 am
by MajkiFajki
shader of windows:

Code: Select all

textures/ut4_polandwindows/polokno1

{

   {   

      map textures/ut4_polandwindows/polokno1.tga

   }

   {

      map textures/ut4_polandwindows/reflet01.jpg

      tcgen environment

      blendFunc GL_ONE GL_ONE
      rgbGen const ( 0.2 0.2 0.2)
      tcMod scroll 0.0200 0.00200

   }



   {

      map textures/ut4_polandwindows/polokno1.tga

         blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA

   }

   {

      map $lightmap

      blendfunc GL_DST_COLOR GL_SRC_COLOR

   }

}



No effects I guess...
Image
Image

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 12:03 pm
by Rayne
// plain white glass
textures/glass/glass7
{
qer_editorimage textures/glass/glass7.tga


qer_trans .5
cull disabled
q3map_lightmapFilterRadius 0 32
q3map_backSplash .5 -16


{
map textures/glass/glass7.tga

rgbGen identity
blendFunc filter
}
{
map textures/resident/sfx2.tga
tcgen environment

blendFunc add
rgbGen const ( 0.3 0.3 0.3 )
}


}


I think that one might work. Not sure haven't used it in a while and don't have time to test it right now. It's pretty old so it might same some bugs.

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 12:58 pm
by MajkiFajki
Still nothing :(

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 1:34 pm
by Rayne
// plain white glass
textures/glass/glass_Statue
{
qer_editorimage textures/glass/glass_Statue.tga


qer_trans .5

q3map_lightmapFilterRadius 0 32
q3map_backSplash .5 -16


{
map textures/glass/windows2.tga
tcgen environment
blendFunc add
rgbGen const ( 0.3 0.3 0.3 )
}


}


This is about as simple as it can be. No basic texture just an image that impersonates reflection. Clear white glass.

rgbgen const controls the opacity and color.

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 2:22 pm
by ValkoVer
Try this

Code: Select all

textures/coldwar/window
{
            qer_editorimage textures/coldwar/window.jpg
   {
           map textures/coldwar/vv_env.jpg
           blendFunc GL_ONE GL_ONE
           tcgen environment
   }
   {
                    map textures/coldwar/vv_window.tga
   }
   {
           map $lightmap
                    rgbGen identity
                    blendFunc filter
   }
}

Re: Shiny surface of windows

Posted: Thu Sep 01, 2011 3:40 pm
by MajkiFajki
Image
Image

SOLVED

Posted: Tue Sep 06, 2011 8:04 am
by MajkiFajki
Delirium helped me out on IRC. The correct shader is:

Code: Select all

textures/ut4_polandwindows/polokno1
{
   {   
      map textures/ut4_polandwindows/polokno1.tga
   }
   {
      map textures/ut4_polandwindows/polodbicie1.jpg
      tcgen environment
      blendFunc blend
      AlphaGen const 0.2
      tcMod scroll 0.0200 0.00200
   }

   {
      map textures/ut4_polandwindows/polokno1.tga
         blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
   }
   {
      map $lightmap
      blendfunc GL_DST_COLOR GL_SRC_COLOR
   }
}



Two important lines are:
blendFunc blend
AlphaGen const 0.2