Improvements for env_pojectedtextue(lamps, flashlights, shadow-casting lights)

I’ve always liked this entity, mainly because it’s the only “real” light. It properly casts shadows and lights the world.

You have likely seen it used before, as it’s primary use in GMOD is for lamps, flashlights, and I’ve seen some people trying to use them in their maps.

Now it’s main problem is that the shadows don’t have much range before they become blurred into nothing. This is due to over-jittering, supposed to cover up pixelation due to low shadowmap resolution.

There is no work to be done to fix this, I am supplying you(Garrys Mod team) with the code to do this, it’s only one or two lines of code and I have yet to see any negative affects.

Also, in case your wondering: “can we use this as a sun?”
The answer is: Likely not, to allow for a completly dynamic sun like in JC2, MW2, Crysis and such, we would need to re-code some of the shadow mapping system. Those games likely use parallel split shadow maps or perspective shadow maps for sunlight. Though, you could use it like Portal 2 does, a main light source for rooms.(An example of this use is posted below Reactor’s reply).

TL;DR Version

Fix the env_projectedtexture grain.

I would greatly appreciate this and think it would be a great addition to GMOD, as it would allow more use of dynamic lighting. Which is great for scenes that need dramatic lighting.

I don’t see where it would be completely necessary, no offense, but I mean, would this have any effect in first person?

Well, it does make the entity more useful, allowing much cleaner shadows compared to the very graining shadows it has now.

Also, there is much more effect in first person.

By the way, half the stuff requested here isn’t necessary. And this is quite a simple thing to fix, I even provided the filter fix myself. I can’t get the shadow map resolution fix because I do not know enough Cpp, I bet it would be easy with the information I provided to figure it out for someone with experience.

Well, it didn’t seem like to many people understood what I was saying, or maybe no one cares. Either way, here is some of the uses for env_projectedtextures(dynamic lights):

Added to the first part of the first level of HL2:

All of these are completely dynamic shadows, they also cast shadows onto models and allow for self-shadowing. All that is required to do this is about one or two lines of code and a few(3) CVar edits.

There is no longer any work in this, I have the information and step by step instructions on how to do this. There is no real work to be done by Garry or who ever compiles the code for GMOD.

Interlopers topic:

So this would fix the fast fading distance of the lamp tool?

Fading distance? No, this fixes the over jitted/graining shadows, which makes them unusable for anything but small-scale scenes.

Suppose I would find the fading distance value, if people find it too much of a problem.

Oh god, this is sexy. I want it in gmod now…

As do I. Though, I may have to try and contact Garry directly about it.

I know people would like these fixes, I’ve seen the topics, such as gm_bricks, where people were saying how the shadows are way to grainy.

By the way, any modder’s can use the code found at the end of the link in the OP.