id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Textures => Topic started by: spamclark15 on August 07, 2017, 04:30:22 AM

Title: Plasma Gun Material
Post by: spamclark15 on August 07, 2017, 04:30:22 AM
Something I'm trying to fix is the player shadow being cast on the Plasma gun. This is the only gun that has this behavior, and also the only gun that will cast a shadow of itself onto objects like dead monsters. The pictures show the player shadow casting ugly shadows on the top of the plasma gun, the plasma gun casting a shadow on a dead pinky, and for comparison, the machine gun, which does not do this. What is going on?
Title: Re: Plasma Gun Material
Post by: Snehk on August 07, 2017, 04:57:09 AM
Check the material if there is noShadows or noSelfShadow. Maybe plasma gun material doesn't have those?
Title: Re: Plasma Gun Material
Post by: spamclark15 on August 07, 2017, 05:02:01 AM
...and that was it. The world mesh is missing noSelfShadow so I added it and it fixes both problems? Are the viewmesh and worldmesh separate? I figured the game handled them separately but apparently not if flags on one affect the other?
Title: Re: Plasma Gun Material
Post by: Snehk on August 07, 2017, 05:57:25 AM
Viewmesh and worldmesh are separate models, guess that they use the same material for both of them?
Title: Re: Plasma Gun Material
Post by: spamclark15 on August 07, 2017, 06:20:22 AM
No, if they shared a material then they'd be using the same textures as well.
Title: Re: Plasma Gun Material
Post by: Phrozo on August 09, 2017, 02:29:43 AM
There is a separate material for world and view models. Put noShadows on the plasmagun world material and noSelfShadow on the plasmagun view material.
Title: Re: Plasma Gun Material
Post by: spamclark15 on August 09, 2017, 03:10:13 AM
All it took was noSelfShadow on the world model material. As weird as that is, it prevents player shadows from appearing on the view model material as well. This is why there's more than meets the eye with this I think.