[SOLVED] Shiny surface of windows

Having a problem with a shader or texture
Post Reply
MajkiFajki

[SOLVED] Shiny surface of windows

Post 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?
Last edited by MajkiFajki on Tue Sep 06, 2011 8:05 am, edited 1 time in total.

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Shiny surface of windows

Post by Rayne »

rgbGen const ( 0.2 0.2 0.2) in the glass shader, more precisely in the stage that adds the reflection image.

MajkiFajki

Re: Shiny surface of windows

Post 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

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Shiny surface of windows

Post 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.

MajkiFajki

Re: Shiny surface of windows

Post by MajkiFajki »

Still nothing :(

User avatar
Rayne
Site Admin
Posts: 624
Joined: Wed Aug 17, 2011 5:22 pm

Re: Shiny surface of windows

Post 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.

User avatar
ValkoVer
Posts: 176
Joined: Mon Aug 22, 2011 11:01 am
Location: Poland

Re: Shiny surface of windows

Post 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
   }
}

MajkiFajki

Re: Shiny surface of windows

Post by MajkiFajki »

Image
Image

MajkiFajki

SOLVED

Post 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

Post Reply