Jump to content

Shaders issue on saber (solid blade)


Recommended Posts

Posted

The new saber i'm doing has some light problem. One side is lighted while the other isn't like this :

edit - it is always the same sides, despite of lights.

 

14030810170014140512047854.jpg

 

 

Moreover I don't really know how to do shaders actually. I tried anything with a white image, just for beginning and testing. Then someone suggested me a new code but the issue does remain. There is still only one side lighted... here is the last code i tried :

 

 

 

models\weapons2\blazefire\blade
{
   q3map_nolightmap
   q3map_onlyvertexlighting
    {
        map models\weapons2\blazefire\blade
        rgbGen lightingDiffuse
    }
    {
        map gfx/effects/envmap
        blendFunc GL_DST_COLOR GL_SRC_COLOR
        tcGen environment
    }
    {
        map models\weapons2\blazefire\spec
        blendFunc GL_SRC_ALPHA GL_ONE
        detail
        alphaGen lightingSpecular
        cull twosided
    }
}

 

 

Posted

The q3map_ lines aren't necessary, these keywords are only effective in regards to mapping. I'm speculating here because I don't know shaders very well, but perhaps try getting rid of the "cull twosided" line on the third stage.

  • 3 weeks later...
Posted

Thank you, but that didn't work. I have the feeling it doesn't come from .shader actually. I saw ja+ katanas don't have the issue even if it hasn't .shader.

Well, may be i will know a next day how to fixe that...

Posted

Absolutely no problem with modview. The issue remains only in game with light.

Someone told me this is due to quake3 engine... but we don't really know.

Posted

mmm, seems like not recognize the textures. they are into the correct path?

Here it's a code of one of best vampire sword of my legacy of kain mod. it's a sword with a black blade and a skull in the hilt, very good desing. in game appear very nice and with a good lightning. try that syntax: (my blade is a wraith blade, but in your case i think you not need the glow string ) :)

(

 

 

models/weapons2/vampire1/blade
{
q3map_nolightmap
{
map models/weapons2/vampire1/blade
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuse
}
{
map models/weapons2/vampire1/saber_enviro
blendFunc GL_DST_COLOR GL_SRC_COLOR
tcGen environment
}
{
map models/weapons2/vampire1/blade_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
glow
alphaGen lightingSpecular
}
}

models/weapons2/vampire1/hilt1
{
q3map_nolightmap
{
map models/weapons2/vampire1/hilt1
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuse
}
{
map models/weapons2/vampire1/hilt_enviro
blendFunc GL_DST_COLOR GL_SRC_COLOR
tcGen environment
}
{
map models/weapons2/vampire1/hilt1_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
glow
alphaGen lightingSpecular
}
}

models/weapons2/vampire1/hilt2
{
q3map_nolightmap
{
map models/weapons2/vampire1/hilt2
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuse
}
{
map models/weapons2/vampire1/hilt_enviro
blendFunc GL_DST_COLOR GL_SRC_COLOR
tcGen environment
}
{
map models/weapons2/vampire1/hilt2_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
glow
alphaGen lightingSpecular
}
}

models/weapons2/vampire1/horns
{
q3map_nolightmap
{
map models/weapons2/vampire1/horns
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuse
}
{
map models/weapons2/vampire1/hilt_enviro
blendFunc GL_DST_COLOR GL_SRC_COLOR
tcGen environment
}
{
map models/weapons2/vampire1/horns_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
glow
alphaGen lightingSpecular
}
}

models/weapons2/vampire1/skull
{
q3map_nolightmap
{
map models/weapons2/vampire1/skull
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuse
}
{
map models/weapons2/vampire1/skull1_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
glow
alphaGen lightingSpecular
}
{
map models/weapons2/vampire1/skull2_spec
blendFunc GL_SRC_ALPHA GL_ONE
detail
glow
alphaGen lightingSpecular
}
{
map models/weapons2/vampire1/skull_enviro
blendFunc GL_DST_COLOR GL_SRC_COLOR
tcGen environment
}
}

 

Posted

As you can see, need 2 textures: the spec textures are copies of the original with a black chrome effect, yu can make with photoshop or paint shop pro. Combine texture and spec texture into the same shader and yu get realistic light reflection \ refraction efx of the blade ^_^

Posted

mmm, seems like not recognize the textures. they are into the correct path?

 

Yes, they are. no problem with recognition. :/ And actually, each opposite side has the same path...

I wondered if it is due to that there is only one picture for both sides but i saw ja+ sword we called "jpsg10" has the same thing without problem.

Posted

The model it's okay.

 

SAB FILE have some little missing for a realistic melee blade: 

In file SAB add the follow strings:

noClashFlare 1 (avoid the flash of parry with lightsabers)

NoWallMarks 1 (avoid the sword cut the walls like a saber)

BounceOnWalls 1 (allows the blade bounce on the surfaces that's make it solid, alto play the HitOtherEffects parameter. )

NoIdleEffect 1 (the blade cannot cut by touch the enemies, yu are forced to swing it for cut them.

OnInWater 1 (the blade not turn off into water if yu make a wash :P )

----------------------------------

IdleinBack it's new for me, what does it do? Can work for all mods? O.o

 

SHADERS: they are okay, so your issue is very strange. I think the problem is the enviroment. try to make a custome enviroemtn textures instead of

 

  {
        map gfx/effects/envmap
        blendFunc GL_DST_COLOR GL_SRC_COLOR
        tcGen environment
    }

 

Also for lightingDiffuse parameter try something like this:

 

"map models/weapons2/vampire1/blade

alphaFunc GE192  <-- add that.
blendFunc GL_ONE GL_ZERO
rgbGen lightingDiffuse"

Posted

noClashFlare, NoWallMarks, BounceOnWalls, are zero. This is intended. On the other hand, i forget onInWtaer and may be NoldleEffect. Indeed.

 

As i said, i don't think that comes from shader finally. It seems ja+ sword like bride katana haven't any problem without shaders... but i'll try.

Thank you.

Posted

noClashFlare, NoWallMarks, BounceOnWalls, are zero. This is intended. On the other hand, i forget onInWtaer and may be NoldleEffect. Indeed.

 

As i said, i don't think that comes from shader finally. It seems ja+ sword like bride katana haven't any problem without shaders... but i'll try.

Thank you.

You need to set thats parm to 1 for good work of the saber. 0 is default setting. so it's like yu not add this command. Not change nothing.

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