Talk:Env projectedtexture/fixes

From Valve Developer Community
Jump to: navigation, search


after adding most of those fixes the game crashes after adding a env_projectedtexture. what could be the problem?--Pfannkuchen 21:24, 28 January 2010 (UTC)

crash as well

I am also getting a crash only on maps with an env_projectedtexture after making the changes to: targeting, parenting, and number of textures in the game at one time. when are the going to fix this?--uromastix87 13:16, 2 April 2010

Most likely you made a mistake when editing your mod's code. What does the debugger tell you about the cause of the crash? --Ibemad 13:28, 26 January 2013 (PST)


Where can I find all these files to edit? I can't figure out where Clientshadowmgr.cpp is.--Markboydude 05:51, 8 January 2011 (UTC)

In source code from Source SDK. Here is a little tutorial how to get and compile source code --Kave 10:25, 8 January 2011 (UTC)
Well what if I wanted to fix it for a game that already exists e.g. Counter-Strike: Source? --Markboydude 18:52, 12 July 2011 (PDT)
That's not possible. --Artfunkel 07:42, 13 July 2011 (PDT)


After adding code from Fixing targeting.

Crash happens on maps only with Env_projectedtexture.

Other stuff is work.

Flashlight works fine if I run through VS, but not through steam

When I run the game through VS I can turn on my flashlight it runs fine, both in debug and release builds, whether I'm debugging or not. But if I launch the game through steam, the game crashes as soon as I turn on my light. My game appears to be running the newest versions of the DLLs, I'm not getting the copy glitch. I'm not sure what to do. --Stoopdapoop 04:02, 26 July 2011 (PDT)

What happens if you run through Steam, then attach the VS debugger to the process? --Artfunkel 04:16, 26 July 2011 (PDT)
It still crashes when I turn on the flashlight when VS is attached to the process. then it says there's no code available when I break. hmm. Is there an easy/surefire way to make sure that the they're using the same DLL's? my output window has these lines (among many others) when I run it through VS.
'hl2.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\sourcemods\tfdmod\bin\Client.dll', Symbols loaded.
'hl2.exe': Loaded 'C:\Program Files (x86)\Steam\steamapps\sourcemods\tfdmod\bin\server.dll', Symbols loaded.

This leaves me under the impression that it's using the same dll's as the one steam uses. --Stoopdapoop 04:59, 26 July 2011 (PDT)

Fix for "Fixing targeting"

"Fixing targeting" is fixed, let's test it. --VXP 19:19, 28 March 2012 (PDT)


Just did this from start to finish and there are no crashes, appears to be in order. 9/27/12

Particle Effect effected

Following the tutorial closely, i found an eror in my code that effected m_ParticleEffect in particles_simple.h stating the following: Error: object of abstract class type "CParticleEffectBinding" is not allowed:. I did not edit this file so not sure what's going on.

Fixed by replacing the following files with fresh files from a newly created mod.

Fading issue

This tutorial page fixes all the issues except how to remove fading of the projected textures. On my map in game, the farther i go away from the projected texture light, the dimmer the light becomes until it is completely gone. Does anybody know how to disable this? [Unsigned]

Note that: The fading only applies to brushes/world geometry. Models will stay lit no matter the distance. I also believe this only happens in the Source2007 branch.
As for a solution, here is something from AlanEdwardes on ModDB:
I *was* using a shader hack yeah, but that also made it so the player's flashlight projected super far too. So I did a bit of hacking in the C++ and found that if you set the m_fLinearAtten value to something high, it basically negates the view based attenuation (if you have a pretty high farz value):

I think there's a ConVar for it too, however as I mentioned above it breaks Valve's eye shaders, so I modified the FGD to add a "near eyes" flag that makes that value normal when set.

The shader method I found somewhere on a project on Google Code ages ago while searching parts of the shader's code. The author just commented out some lines in the pixel shader with a nice friendly message:

This isn't the best fix, but it's something. --Gary 09:55, 25 January 2013 (PST)

alternate bleeding fix

i managed to fix the bleeding of the projected texture by changing these lines in the c_env_projectedtexture file around line 205.


state.m_flShadowSlopeScaleDepthBias = mat_slopescaledepthbias_shadowmap.GetFloat();

state.m_flShadowDepthBias = mat_depthbias_shadowmap.GetFloat();


state.m_flShadowSlopeScaleDepthBias = 2;

state.m_flShadowDepthBias = 0.000000005;

--Guttato 17:24, 30 January 2013 (PST)