Jump to content

surfacelight issue


Guest KENNITHH
Go to solution Solved by Guest KENNITHH,

Recommended Posts

Guest KENNITHH
Posted

Hey, I'm back at my old map as people asked me to finish it.

 

So I'm at the part of adding lights where I use q3map_surfacelight for a nice lightbar effect but theres something bugging me , in the center you can see theres a little sphere of light. Is there a way to fix this ?

 

f44bcb6b45.jpg

42a28bdda2.jpg

 

 

Also when looking from a distance, it draws the surface through walls a bit (hard to see sometimes - top left)

6b796f1e01.jpg

Shader & GTK

 

 

909319a064.jpg

 

textures/ziba/lightstrip01

{
q3map_lightimage textures/colors/white
qer_editorimage textures/colors/white
q3map_material Glass
q3map_surfacelight 2000
polygonOffset
    {
        map $lightmap
    }
    {
        map textures/colors/white
        blendFunc GL_DST_COLOR GL_ZERO
    }
    {
        map textures/colors/white
        blendFunc GL_ONE GL_ONE
    }
}

Posted

If you want to write shaders, you probably need to learn about blend functions. That shader has 2 more stages than it needs.

 

I'm kind of surprised that there is any light coming off that surface besides the single sphere of light - based on how I understand q3map_lightSubdivide those evenly spaced point lights are the only source of light for surface lights, and their default spacing is one every 120 units. But I never experimented much with them, so I can't tell for sure.

Guest KENNITHH
Posted

I learn better if I see how other people do stuff then try stuff myself rather then theories :P. So I've looked up some maps you made and Szico aswell and I've found out that q3map_backSplash 0 0 fixes that center light but I don't get the 2 more stages needed, is it for the line showing through walls or do you mean I can remove the stages cause theres a lightimage in there?

 

7d8e5bfb0e.jpg

 

I'm currently trying the sort param aswell because when I stand on a light, they start z-fighting

Posted

No, I'm saying that if you only want a white shader, you don't need three stages; you just need a single one, e.g.

{
  map $whiteimage //or textures/colors/white, if you prefer
  blendFunc GL_ONE GL_ZERO
}
together with q3map_nolightmap. Possibly add a glow stage. Your shader visually looks the same, but takes 3x as long to display.

 

This is just a simplification; it should not help with your issue.

  • Solution
Guest KENNITHH
Posted

No, I'm saying that if you only want a white shader, you don't need three stages; you just need a single one, e.g.

{
  map $whiteimage //or textures/colors/white, if you prefer
  blendFunc GL_ONE GL_ZERO
}
 .

 

 

When I use this, the texture doesnt show, now the reason why it showed it through walls seemed to be cause it was a patch mesh and had polygonoffset, changed it to a normal brush and its gone , so basicly this thread is solved !

Thanks mrwonko

 

 

 

Thanks mrwonko and AshuraDX !

 

Solution: Use brush instead of patchmesh

 

 

 

textures/ziba/lightstrip01
{
q3map_lightimage textures/colors/white
qer_editorimage textures/colors/white
q3map_material Glass
q3map_surfacelight 2000
q3map_backSplash 0 0 //fixes the circle light
q3map_nolightmap
sort decal
    {
map textures/colors/white
blendFunc GL_ONE GL_ZERO
rgbGen identity //makes the white texture ALLWAYS fullbright
    }

}

 

Posted

you should try this :

textures/ziba/lightstrip01
{
q3map_lightimage textures/colors/white
qer_editorimage textures/colors/white
q3map_material Glass
q3map_surfacelight  2000
q3map_backSplash 0 0 //fixes the circle light
q3map_nolightmap
sort decal
    {
        map textures/colors/white 
        blendFunc GL_ONE GL_ZERO
        rgbGen identity //makes the white texture ALLWAYS fullbright
        glow
    }
}
Guest KENNITHH
Posted

That works aswell DashuraDX, thanks for that. Eventhough glow doesnt work in SoF2 but I never mentioned it was for SoF2 anyway.

But it might be usefull in the future because I will release the source so people can see how I made it and perhaps learn from it, but they are allowed to re-release it on their game aswell.


 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...