Wasnt there a replacematerial method? I remember something like that. For our 
alternate vision i ended up making a custom version of all the stock shaders 
with a material proxy allowing me to switch between vision modes in the shader 
itself. Advantages there are the switch is immediate and you can change the 
effects outcome per material, contrary to a postprocess. Disadvantages are that 
you have to be able to do it in a shader ofcourse, and that the stock shaders 
leave very little room for modification before you hit the limits of the shader 
model.

-----Original Message-----
From: Zach Brockway
Sent: woensdag 23 februari 2011 0:23
To: hlcoders@list.valvesoftware.com
Subject: [hlcoders] Overriding materials,       especially while rendering 
world (BSP) geometry

Hi list,

I've been investigating the possibility of being able to do across-the-board
material overriding. Motivated by an idea for implementing an alternate
vision mode, it would also entail a few other things like rendering
alternate view setups into render targets; however, all of that seems to be
well-supported and you even get the benefit of examples of how to do it. The
part that I'm really stuck on is the fact that there doesn't seem to be a
way to affect the material used for rendering BSP geometry, since it's all
blackboxed away in the engine.

Things I've tried:

   1. Calling ForcedMaterialOverride on modelrender, studiorender, and
   g_pStudioRender, before render->DrawWorldLists is called. This had no
   effect.
   2. Installing an IBrushRenderer using
   render->InstallBrushSurfaceRenderer. My implementation of
   RenderBrushModelSurface was never called, so I suspect this only affects
   brush-based entities.

Of course, I still have to worry about how to handle the rendering of
*everything else* if I manage to figure this out, but this particular
problem struck me as the biggest stretch for the engine.

Thanks in advance for any advice.

-- 
"They've penetrated our code walls. They're stealing the Internet!"
"We'll need to hack all IPs simultaneously."
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to