Custom Shader Portability Problem


(Eh?) #1

With a little (okay, quite a bit :)) of help from Drakir, I’m working on some hedgerows. The hedgerows are basically made of three alpha-enabled brushes, and appear as expected in the sample map:

If I copy this brush into my ‘real’ map file, though, the following happens:

This happens if I use copy/paste between the two map files, and also if I construct brushes from scratch in the main map file. If I construct the same brush in the sample map, though, it appears as expected. :banghead: The map files are both in the same folder.

Any ideas on what causes this discrepancy between the two map files?


(Java.Lang) #2

It sounds like it isn’t reading your SHADER file in the second map.


(Moonkey) #3

The alpha still seems to work, so I’d say your shader is still working.
Could just be a difference in lighting or compilation?


(Eh?) #4

I’m pretty sure the shader files are being read, as other shaders in the same file are appearing correctly, and as Moonkey points out, the alpha transparency is appearing correctly. With both maps I’m doing a straight BSP -meta compile, no vis or light stages. Hrm…the sample map is lit only by the ambient property in worldspawn, while the main map has no ambient; the only light so far is the skybox…

I didn’t create the sample map in question, so maybe there’s something different in there…off to check the worldspawn and skybox differences…


(Eh?) #5

Well, the same problem occurs when both maps have the same skybox, worldspawn ambient and _color settings, so that’s not the problem… :confused:

One other problem I just noticed that has to be related: a shrub model (models/mapobjects/tree_temperate_sd/mediumfoliage1.md3) ‘breaks’ between the two maps in the same way: it looks as expected in the sample map, but the texture becomes all washed out in the main map.


(joop sloop) #6

Did you compile the sample map yourself? it might be your compile options that are diffirent from the ones that were used with the sample map


(Eh?) #7

Yes, in trying to figure this out, I’m just sticking to BSP -meta for both maps.


(Eh?) #8

Aha! If I remove the model (models/mapobjects/tree_temperate_sd/mediumfoliage1.md3) - which most likely references models/mapobjects/tree_temperate_sd/leaves_temperate1.tga, the brushes look as expected! Similarly, if I add a model that most likely uses models/mapobjects/tree_temperate_sd/leaves_temperate2.tga, the surfaces assigned a shader that points to that second file breaks in the same way! Since the problem only happens when these models are in the map, there’s clearly some sort of conflict with the shaders that reference the same .tga files that the models do, although how or why is not clear.

I copied and renamed the tga files in question to my own folder, and the hedgerow textures now appear as expected on regular brushes. Here’s a mystery, though: the models have that nasty washed-out look. Strangely enough, I can’t find them in the official PK3 files; this must be related to the problem. Any help/suggestions are appreciated… :???: