Shadow Mapping in Source

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

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
Dumpling
Dumpling
 
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? I haven't been active lately, but feel free to 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? I haven't been active lately, but feel free to 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
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

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
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7

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

Re: Shadow Mapping in Source

Postby Epifire on Fri Aug 17, 2012 5:01 am

So for something which I have heard is inherently simpler to port, is there a possibility of installing the CS:GO skybox lighting into the '07 engine? I heard it was just a new shader which acted like a huge projected texture for the skybox shadowing. If it would be possible to port it, that would do wonders on the Ravenholm mod the team and I have been working on. Thanks so much for answering a lot of my questions though Bio, it is just really great to talk to some one who works directly with this stuff.
Image
User avatar
Epifire
Senior Member
Senior Member
 
Joined: Fri Mar 25, 2011 8:54 pm
Location: Minnesota, where you're froze 24/7
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users

cron