| 20:53:57 9 August 2013
On forum: 04/05/2007
Message edited by:
Edited at bottom of post
Sorry for bumping such an old thread, but I've been experimenting with this over the past two days and think I'm finally getting somewhere.
Before no matter what I tried to use for models_weapons.s it would be either transparent or some other glitch would occur.
Now I can get it to appear in the normal place, with one of them looking the way it should look (sorta, I'll explain).
Method 1: http://pastebin.com/CXgHwHxW
The model reacts to light and appears correctly, but it's very dark.
Method 2: http://pastebin.com/ELqVWg7C
This version as far as I can tell looks identical to the vanilla version, however there is a graphical glitch in the sky with it enabled.
I obviously don't understand shaders that well so it's probably some simple mistake I made that can be fixed and then models_weapons can finally be modified.
I also sent an email about this to team Dezowave as they've been helpful to me in the past so hopefully they'll help again.
Just posted this since I'd love a better lighting model and reflection map for weapons, but first we need to figure out how models_weapons is handled internally to begin with.
Got it working finally.
In the screenshot the hands and AK74 uses the new weapon shader, the hands are using vanilla (renamed the weapon shader for the ak to models_weapon5 by hex-editing and created corresponding models_weapon5.s file)
Here's the models_weapons.s file used: http://pastebin.com/bEWLTdAV
1) I don't think it uses a bump map (yet, I need to find a better example to see if it gets read. If it doesn't it shouldn't be hard to fix I imagine)
2) The reason I was getting either the glitch in the sky before or a dark model is because I used the VS shader for accum_volumetric which causes problems.
It looks like the first part of the shader line corresponds to the VS, and the 2nd is PS. I set VS to null and thus it came out correctly.
3) The lighting and shadowing on the model is identical to vanilla weapon shader
Now to improve on it by adding a cubemap, maybe writing a custom lighting file for it instead of using accum_volumetric, etc.
Since I was nice enough to share, if anyone including myself creates some neat results lets share it/keep it open source guys.