Shadow Mapping in Source

Grab your favourite IDE and tinker with the innards of game engines

Re: Shadow Mapping in Source

Postby -=Biohazard=- on Thu Jul 12, 2012 12:11 pm

ScarT wrote:Textures with $selfillum crashes for me, even in the build on the SVN.

Code: Select all
Unhandled exception at 0x0DB0EE80 (shaderapidx9.dll) in swarm.exe: 0xC0000005: Access violation reading location 0x0000000C.


It points me to line 423 in \materialsystem\swarmshaders\defpass_composite.cpp
Specifically at
pShaderAPI->SetPixelShaderConstant( 10, params[ info.iSelfIllumTint ]->GetVecValue() );

The callstack can be found here.
http://pastebin.com/t0HqjQ41


Did you use it on a brush?
It looks like I forgot to copy the self illum vars to deferred_brush (only tested it on models actually...).
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Shadow Mapping in Source

Postby ScarT on Thu Jul 12, 2012 2:02 pm

Yes, it was used on a brush. I added the variables and that fixed it.
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: Shadow Mapping in Source

Postby ScarT on Fri Jul 27, 2012 7:27 pm

Bump.
I'm having some odd problems with this.

I compiled the map with the light entities, some added in the ingame editor, and some in Hammer. I load up the map, and it seems the light settings from the light_deferred_global aren't applied.

Image

I load the VMF, same as the compiled one, and the light_deferred_global settings are applied. Any ideas?

(Its a dark map, so spotting the difference is hard in the down scaled version of the images)

Image

Also, I've noticed that materials that's using the deferred_brush shader falls back to lightmappedgeneric if they've got $translucent specified and not having $decal at the same time, but I'm having a hard time seeing the difference that'd make. So why is this even done? Materials falling back will be fully lit up.
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: Shadow Mapping in Source

Postby AniCator on Sat Jul 28, 2012 10:57 am

Is there anyone that can maybe help me integrate fetch4 code into the shaders. I haven't done a lot of shader programming yet but I really need this to work on ATI since I'm making a small mod for a community.

Here's a video of what I've been working on (running on NVIDIA):
http://www.youtube.com/watch?v=Zj4SwA76qhE
AniCator
Just Joined
Just Joined
 
Joined: Sat Jul 28, 2012 10:51 am

Re: Shadow Mapping in Source

Postby Gary on Sat Jul 28, 2012 2:51 pm

Its one line of code to switch over to software shadow filtering. I've been busy, so I haven't had time to look it up.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Shadow Mapping in Source

Postby -=Biohazard=- on Wed Aug 01, 2012 11:55 pm

ScarT wrote:I compiled the map with the light entities, some added in the ingame editor, and some in Hammer. I load up the map, and it seems the light settings from the light_deferred_global aren't applied.


Compile in debug mode and try to start debugging at 'static lightData_Global_t GetActiveGlobalLightState()'.

ScarT wrote:Also, I've noticed that materials that's using the deferred_brush shader falls back to lightmappedgeneric if they've got $translucent specified and not having $decal at the same time, but I'm having a hard time seeing the difference that'd make. So why is this even done? Materials falling back will be fully lit up.


There's a huge difference because the decals are ignored by anything lighting related, they are just rendered in the second pass. It's simply not possible to light alpha blended geometry alongside with the rest, there are solutions that are either more costly or don't really work well to begin with so alpha blended geometry is simply unlit for now...
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Shadow Mapping in Source

Postby Gary on Fri Aug 03, 2012 12:31 am

I think there should be a tad more explanation so people can understand exactly what the "deferred mod" does. We don't need something super detailed. Just a basic idea on what your mod does and how it works.

As far as I understand it(which isn't much, I'm no graphics programmer), this mod adds a new pass, the deferred lighting pass, to the rendering of the scene. You skip all other lighting methods(light mapping and such). You take the scene, load it to a render target( of course there are other render targets for shadows ), get all the new light entities information and position, do the lighting based on that. And send it back to be processed in the framebuffer. Of course you need new shaders and materials that will accept this new method of lighting objects(VertexLitGeneric/LightMappedGeneric doesn't make sense in this new pipeline, hence the new deferred_brush and stuff which properly accepts the new lighting information).

So, the deferred mod, is adding the deferred lighting pass and shaders, skipping the old stuff, and adding new light entities. If I'm wrong, Bio, or someone, correct me please.
Have a question related to modding or something I posted? Something that needs staff attention? PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Shadow Mapping in Source

Postby Epifire on Fri Aug 03, 2012 1:12 am

So basically any models or textures running on the deferred mod would have to refer to different shaders entirely? That would mean a lot of recompiling existing models if you were using a lot of them with this technology?
Image
User avatar
Epifire
May Contain Skills
May Contain Skills
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Kansas... where tumble weeds are entertainment.

Re: Shadow Mapping in Source

Postby Carbon14 on Fri Aug 03, 2012 3:14 am

This looks incredible, but I am guessing that at the moment its a very solid proof of concept rather than something usable? I mean, Source without working 3d skyboxes and semi transparent materials is not going to really be usable for an actual mod right?
User avatar
Carbon14
Regular
Regular
 
Joined: Sat Sep 22, 2007 3:33 am

Re: Shadow Mapping in Source

Postby ScarT on Fri Aug 03, 2012 3:29 am

-=Biohazard=- wrote:Compile in debug mode and try to start debugging at 'static lightData_Global_t GetActiveGlobalLightState()'.


So far I've found nothing useful. It doesn't happen on all maps, which is odd.

-=Biohazard=- wrote:There's a huge difference because the decals are ignored by anything lighting related, they are just rendered in the second pass. It's simply not possible to light alpha blended geometry alongside with the rest, there are solutions that are either more costly or don't really work well to begin with so alpha blended geometry is simply unlit for now...


Pardon me for being ignorant. I tried disabling the checks for $decal and $translucent in the shader code, and the output looks fine. What am I missing?

Carbon14 wrote:This looks incredible, but I am guessing that at the moment its a very solid proof of concept rather than something usable? I mean, Source without working 3d skyboxes and semi transparent materials is not going to really be usable for an actual mod right?

Get on IRC or Steam. You have access to our SVN with this.
User avatar
ScarT
Senior Member
Senior Member
 
Joined: Sat Apr 02, 2005 7:33 pm
Location: Denmarkian Land

Re: Shadow Mapping in Source

Postby MrTwoVideoCards on Fri Aug 03, 2012 3:53 am

Carbon14 wrote:This looks incredible, but I am guessing that at the moment its a very solid proof of concept rather than something usable? I mean, Source without working 3d skyboxes and semi transparent materials is not going to really be usable for an actual mod right?


3d skyboxes work bro.
User avatar
MrTwoVideoCards
Monothetic
 
Joined: Thu Aug 02, 2007 11:18 am
Location: IN YOUR SOUL

Re: Shadow Mapping in Source

Postby -=Biohazard=- on Fri Aug 03, 2012 11:54 am

@Gary You are basically right. But it may be important to point out that 'deferred lighting' means rendering data like depth and normals to a RT first, writing the lighting to another RT (like you said) and then rendering the complete scene a second time where the lighting is applied (albedo wasn't read before at all etc). The first pass with normals and depth as output skips unlit stuff and decals.

You can also find some general info on wikipedia btw.

Epifire wrote:So basically any models or textures running on the deferred mod would have to refer to different shaders entirely? That would mean a lot of recompiling existing models if you were using a lot of them with this technology?


The shaders just get replaced at runtime.

ScarT wrote:Pardon me for being ignorant. I tried disabling the checks for $decal and $translucent in the shader code, and the output looks fine. What am I missing?


Your material is either being lit based on the data that was written by the geometry 'behind' your material or the partially visible geometry behind your material isn't lit at all. One of those is the case, depending on whether you're drawing it during the first pass too or not. It may look good enough depending on your material/scene, but that's not always the case.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Shadow Mapping in Source

Postby Epifire on Fri Aug 03, 2012 5:50 pm

I know the question has gone around a lot in this thread, but I have not read any direct answer on it yet. Is this kind of technology limited to use in the ASW engine or is there a chance to see it working in 2007 as well? If it does not currently work on '07 is there work being done to make it compatible, or is it just not practical with that build?

The Centrifuge team and I could really use this in our Ravenholm mod, since our night levels would benefit much from it. We have been building on the 2007 engine so that is where my question comes into play.
Image
User avatar
Epifire
May Contain Skills
May Contain Skills
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Kansas... where tumble weeds are entertainment.

Re: Shadow Mapping in Source

Postby nub on Wed Aug 08, 2012 4:21 am

Gary wrote:Biohazard released it:


"Enable Volumetrics."

Oh...my...god...


I fucking love you, Bio.
User avatar
nub
Veteran
Veteran
 
Joined: Tue Nov 15, 2005 1:11 am
Location: Charlotte, NC, US

Re: Shadow Mapping in Source

Postby -=Biohazard=- on Mon Aug 13, 2012 6:55 pm

Epifire wrote:I know the question has gone around a lot in this thread, but I have not read any direct answer on it yet. Is this kind of technology limited to use in the ASW engine or is there a chance to see it working in 2007 as well? If it does not currently work on '07 is there work being done to make it compatible, or is it just not practical with that build?

The Centrifuge team and I could really use this in our Ravenholm mod, since our night levels would benefit much from it. We have been building on the 2007 engine so that is where my question comes into play.


It can definitely be ported to 2007 (porting != copying); however, I am not planning to do that myself at any point.
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users