Can't get this custom shader to work.
Started by Kyokkai
avatar
Kyokkai Rep. 0
#1   01 Jul 2014
I admit that maybe I don't fully understand the shader manual, I've found it pretty impenetrable really..
Here's the shader code anyways.
-------------------------------------------------
textures/custom/checkerfloor
{
qer_editorimage textures/custom/checkerfloor.tga
{
map $lightmap
rgbGen identity
}
{
map textures/custom/checkerfloor.tga
rgbGen identity
alphaGen lightingSpecular
}
{
map textures/custom/glossfx.tga
blendfunc add
rgbGen identity
tcGen environment
}
}
---------------------------------------------------------------------
What's weird is it displays properly in Q3ASE and in the little curry plugin that comes with gtk 1.2.9
Here's a pic of what it should look like in game and does look like in gtkradiant and Q3ASE.
i.imgur.com/pNxfgVg.jpg
In game though it just appears completely flat, does somebody know what's wrong?
Both the checkerfloor texture and the gloss texture are 32 bit TGA files made in gimp.
avatar
Tig Rep. 2422
#2   01 Jul 2014
Does a "\condump" point to any missing textures?
avatar
leilei Rep. 443
#3   01 Jul 2014
A missing texture in the shader would invalidate the whole shader.

is vertexlight turned on in-game? Vertexlight boils shaders to a single stage only.

Also, since you have the lightmap as the first stage, you must blend the second stage on it to see the lightmap. Use blendFunc filter, and remove alphaGen lightingSpecular from that stage - which only works with alpha blending functions anyway.

For your third stage, I would change rgbGen to identityLighting so the renderer will darken according to overbright bits so the shine doesn't look so eye-blindingly bright.

Edited 5.57 minutes after the original posting.

avatar
Kyokkai Rep. 0
#4   01 Jul 2014
No errors in the condump and all the shaders seem to be there.
Hmm what about this?

"picmip: 1
texture bits: 0
multitexture: enabled
compiled vertex arrays: enabled
texenv add: enabled
compressed textures: disabled"

The .tga's were saved with RLE compression, could that be the cause?

avatar
leilei Rep. 443
#5   01 Jul 2014
No. Compressed textures refers to S3TC texture compression technology (which video cards natively support to save VRAM usage), and is completely unrelated to TGA's. file compression. It's best to have compressed textures disabled for maximum possible quality and shortest loading times.
avatar
Kyokkai Rep. 0
#6   01 Jul 2014
No my lighting is set to lightmap.
I changed the shader to this now.
-------------------------------------------------------------------
textures/custom/checkerfloor
{
qer_editorimage textures/custom/checkerfloor.tga
{
map $lightmap
rgbGen identity
}
{
map textures/custom/checkerfloor.tga
blendfunc filter
rgbGen identity
}
{
map textures/custom/glossfx.tga
blendfunc add
rgbGen identity
tcGen environment
}
}
-------------------------------------------------------
Still didn't work.
Both the named .tga files are in the exact path described in the shader and both are named properly without any mistakes.
Does the shader name require I make a .jpg version of checkerfloor.tga or something? Do I need to hook up a specific texture to the $lightmap?

Edited 16.47 minutes after the original posting.

avatar
leilei Rep. 443
#7   01 Jul 2014
Don't use rgbGen lightingDiffuse on map textures. That is for model shaders only. Use rgbGen vertex if you want to apply calculated vertex lighting to your shine effect.

The engine automatically determines which lightmap is used for map $lightmap. It's a special texture.

The engine should automatically truncate the image file extension to seek whether a JPG or a TGA is available (TGA takes priority).

Edited 1.62 minutes after the original posting.

avatar
Kyokkai Rep. 0
#8   01 Jul 2014
Changed it to rbgGen Identity, still it won't work though.
Here's an ingame pic.
i.imgur.com/JBbhxYK.jpg
It simply refuses to have the glossy effect.
-------------------------------------------------------
Edit - Managed to fix it.. you won't believe what the solution was..
Apparently it didn't like the name "custom" for the shader..

Edited 2.79 hours after the original posting.

Only registered members can post a reply.
Already registered? Sign in.

enig-dm1
Clear