I still cannot get MD3s or ASEs to Clip.


(sPUNKmonKEY) #1

This functionality would help me in my map increadibly. I’ve viewed Canyon and it rocks as an example. Nothing I do actually gets the models to autoclip. I am using the latest build of q3map2.

As a test I created a box in Max2.5. I made it 32x32x32 (cause YDNAR said it was a hack that generated clipping in 8 unit chunks) So I thought the box couldn’t fail. I exported it in two ways. First an MD3. Second as an ASE with the following options checked (MESH DEFINITION, MATERIALS, MESH NORMALS, MAPPING COORDINATES, and GEOMETRIC OBJECT TYPES). After exporting I compared it to the ASE file in YDNARS canyon. Identical with the exception being number of poly or tris data. Next I added q3map_clipModel to my shader so it looks like this:

textures/9oclock/9ocars04
{
qer_editorimage textures/9oclock/9ocars04.tga
q3map_lightimage textures/9oclock/9ocars04.tga
q3map_clipModel
surfaceparm alphashadow
surfaceparm metalsteps
{
map textures/9Oclock/9ocars04.tga
rgbGen exactVertex
}
}

I placed both the MD3 and the ASE in the same test scene and using the Q3Map2 (final) BSP -meta, -vis, -light -fast -filter -super 2 I compiled it. I did no postprocessing (AAS or ShaderEX) to it so as not to screw anything in the new BSP up.

Still no clipping taking place. So I then added the spawnflags 2 to the misc_model entity window (YDNAR posted something about the second spawnflag bit being set as another workaround). Recompiled and still no clipping. What am I doing wrong? Please someone help me. /me beggs. Any info is appreciated. I’m spinning my wheels here.


(Hewster) #2

Hi,

Well It took me a while of staring at your shader before I saw it :slight_smile:

I think your problem is the name of your shader, it is the same as
the texture… try re-naming the shader to:
textures/9oclock/9ocars04_clip

Apply it to your models and try again…

If that don’t work, then I’m not sure why… try making an irregular shaped
model ?

Hope this helps

Hewster


(sPUNKmonKEY) #3

Thanks for the help, it wasn’t the answer but got me going in the right direction. After changing my shader file about 5 times I got 2 to work and 3 that didn’t. What I finally figured out was that the surfaceparm alphashadow causes the autoclipping to not work. Once I removed it my shaders worked fine. I had it in there due to a post in the old forum where ydnar listed surfaceparm alphashadow and rgbGen exactVertex as two things you wanted in your MD3 shaders to get them to look nice. However, I have removed the surfaceparm alphashadow and things still look fine (I guess I haven’t noticed a difference even after taking out my $lightmap phases).

For anyone else who understands things much better than I do, does the fact that I am using a JPG as my texture rather than a 32bit TGA have anything to do with the surfaceparm alphashadow causing a problem with the clipping? If I had an alphachannel in my TGA would this control the generation of clipping in certain spots of the model?


(r3tina) #4

what does rgbGen exactVertex do? I’ve come across this rgbGen keyword before, but it’s not listed in the shadermanual, nor is it included in q3ase. Is it similar to rgbGen vertex, or perhaps the same?


(sPUNKmonKEY) #5

This was originally posted by YDNAR in the old forums

“model2” models are handled in-game, and thus must have an “rgbGen lightingDiffuse” in the shader to be lit properly in-game.
Shaders on static models must use “rgbGen vertex” or “rgbGen exactVertex” to get the stored vertex light out of the BSP (misc_models).

Not certain what the difference between vertex and exactVertex are, anyone elaborate?

YDNAR also posted this as a followup

Entities do not cast shadows. Entities with “model2” models will never recieve shadows because they are only referenced in-game, hence “rgbGen lightingDiffuse.” This means they use the lightgrid to determine their coarse ambient + directed illumination.
You should also remove the lightmap stage from the first shader. Lightmaps do not apply to MD3 models, especially dynamic (model2) models.
Also, add “surfaceparm pointlight” or “nolightmap” to all of your shaders.