Omni-Directional Env_ProjectedTexture

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

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Thu Sep 30, 2010 6:54 pm

Valve seems to refer to lights that can light objects in real time(not during compile) as "dynamic lights".

I am inclined to assume that "d_light" does not cast shadows.

Also, something else, I assume because omni-directional lights would cover more area, it would have to stretch the scene over a shadow map, thus making shadow asing look even worse.


What I think we need, is something like PSSM... so we could have a env_projectedtexture sun! Now all we need for that is a graphics programmer.
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: Omni-Directional Env_ProjectedTexture

Postby Gary on Sun Oct 24, 2010 8:45 pm

Found this:
http://www.gamedev.net/reference/articl ... le2457.asp

Funny, basically it's the same thing I did, but through coding.

EDIT: I did not do this in the post below, I suck at programming at the moment.
Last edited by Gary on Sun Oct 24, 2010 10:40 pm, edited 1 time in total.
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: Omni-Directional Env_ProjectedTexture

Postby Gary on Sun Oct 24, 2010 10:33 pm

Someone asked me to post the omnidirectional light I posted in this thread a few pages back. I re-did it because I didn't want to give something out that was a buggy pile of crap, so here it is, my version of an omnidirectional shadow mapped light.

Basically this is all the VDC fixes(including mine) and six 120-degree env_projectedtextures facing in different directions. Due the lights being 120 degrees, the light's view is stretched on the shadow map, resulting in even lower resolution shadows(restricted to even smaller scenes).

This demo has no gravity for props, found it was better for testing purposes.
Image
Click on the computer monitor that is sitting on the desk and everything explodes(not killing the player).
Image
Image


Included in download:
Custom Bins
The living room map(in pictures above)
The living room VMF


[Download | 3.56 MB], place in SourceMods folder.
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: Omni-Directional Env_ProjectedTexture

Postby Hollow on Mon Oct 25, 2010 7:05 am

wow awesome stuff gary.
User avatar
Hollow
Ubisoft/Monothetic
 
Joined: Thu Aug 14, 2008 12:38 pm
Location: London, UK

Re: Omni-Directional Env_ProjectedTexture

Postby Dabu on Mon Oct 25, 2010 3:33 pm

Hollow wrote:wow awesome stuff gary.

Like always. :P Do you plan to make bins for any non-code mod, Gary?
Image
User avatar
Dabu
Dumpling
Dumpling
 
Joined: Sun Feb 08, 2009 9:01 pm

Re: Omni-Directional Env_ProjectedTexture

Postby joe_rogers_11155 on Mon Oct 25, 2010 4:01 pm

gary, i wanted to ask about the dynamic lights hitting the player's weapon model. does it work correctly or does the player not get affected?
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Mon Oct 25, 2010 5:01 pm

Hollow wrote:wow awesome stuff gary.


Glad you like it, sorry it took so long, I had to take a second look at it to finally get it to work.


joe_rogers_11155 wrote:gary, i wanted to ask about the dynamic lights hitting the player's weapon model. does it work correctly or does the player not get affected?


The view models receive shadows and light from the env_projectedtextures if that was what you are asking. I was also trying to get the player to cast a depth texture but no luck(I only got it to cast an RTT shadow).


Dabu wrote:[...]Do you plan to make bins for any non-code mod, Gary?


What do you mean by this?
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: Omni-Directional Env_ProjectedTexture

Postby Dabu on Tue Oct 26, 2010 1:40 pm

Gary wrote:What do you mean by this?

I mean I'd really like to use it in mah mod but I can't. Your bins always cause engine crash. :[
Image
User avatar
Dabu
Dumpling
Dumpling
 
Joined: Sun Feb 08, 2009 9:01 pm

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Wed Oct 27, 2010 7:32 pm

Why would you use this codebase for your mod?

The best thing to do, is just add the fixes from the VDC to your mod, that's all you need to get this to work. I am also looking into a better solution for this, I need to make a better texture for the light so I can lower the fov(which will make the shadows look better).


Also, can anyone that tries this demo out please post your FPS, CPU and GPU?
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: Omni-Directional Env_ProjectedTexture

Postby dark0r on Wed Oct 27, 2010 9:08 pm

Average FPS: 120
CPU: Intel Core 2 Quad Q6600 @ 3.6GHz
GPU: ATi Radeon HD 4870X2
Resolution: 1680x1050
All other Advanced Video settings: maximum
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Wed Oct 27, 2010 10:29 pm

Thanks dark0r for the information and I'm not surprised it runs so well on your computer.
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: Omni-Directional Env_ProjectedTexture

Postby Plague on Thu Oct 28, 2010 12:28 am

High FPS: 31
Low FPS: 28
Average FPS: 30

All maxed out settings, 1920x1080 Screen res.
intel Core 2 Quad (2.40GHz X 4)(Forgot the ID)
Nvidia Geforce 8800 GTS

IMO a last gen gaming PC.

No noticeable frame-rate issues, would go into 40s when in another room but drops to 30s when in the same room as the light.

I might add that the scene you made shows off the dynamic lighting amazingly Gary, almost surreal XD.
Contact. The EU welcomes the pain free. That's emotional impact.
I actually think limitation is good for creativity. If we had an engine that could do everything, we would be in trouble. It gives us focus. ~~ Randy Lundeen
User avatar
Plague
Veteran
Veteran
 
Joined: Tue Jun 22, 2010 7:12 pm

Re: Omni-Directional Env_ProjectedTexture

Postby dark0r on Thu Oct 28, 2010 12:41 am

Gary, incase you hadn't noticed it's Saul :p

After hours of work I've finally managed to make the depth resolution any value you want. At 4096 (4 times greater than Gary's mod posted above), the shadows are spectacular, with very defined and soft edges when the jitter amount is about 0.1-0.2. I will post a screenshot tomorrow as it's 1:30 at the moment and the PC just completely froze when I tried going up to 8192 :D For the record I get about 60fps with the depthres at 4096, which is pretty stable.

Oh and Gary, have you tried using 6 90 degree lights with a fully white texture yet? That should improve performance greatly :D
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Thu Oct 28, 2010 1:49 am

Thanks Plague.


dark0r wrote:Gary, incase you hadn't noticed it's Saul :p

After hours of work I've finally managed to make the depth resolution any value you want. At 4096 (4 times greater than Gary's mod posted above), the shadows are spectacular, with very defined and soft edges when the jitter amount is about 0.1-0.2. I will post a screenshot tomorrow as it's 1:30 at the moment and the PC just completely froze when I tried going up to 8192 :D For the record I get about 60fps with the depthres at 4096, which is pretty stable.


We must talk. Now. I was able to get the res higher, but it always got reshaped when displayed causing the shadows to become spewed everywhere. Also, Source can't handle 8192.

dark0r wrote:Oh and Gary, have you tried using 6 90 degree lights with a fully white texture yet? That should improve performance greatly :D


Doubtful it would effect FPS, but it would make them look better. I have had problems making custom flashlight textures.
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: Omni-Directional Env_ProjectedTexture

Postby dark0r on Thu Oct 28, 2010 9:30 am

Screenshots of various depth resolutions with different filter sizes (note r_flashlightfiltersize is a ConVar I created to control all projected texture FlashlightState_t::m_flShadowFilterSize values). My code fixes are available on the Developer Wiki.

r_flashlightdepthres 512, r_flashlightfiltersize 3:
Image

r_flashlightdepthres 1024, r_flashlightfiltersize 1.5:
Image

r_flashlightdepthres 2048, r_flashlightfiltersize 0.5:
Image

r_flashlightdepthres 4096, r_flashlightfiltersize 0.2:
Image

EDIT: Gary I managed to create a fully white flashlight texture and set FOV to 90 degrees, makes the omni-directional light look a look better and more consistent :) Just place the file linked above in your <mod>/materials/effects folder, then on your env_projectedtexture's property window add a KeyValue named texturename, with a value of effects/flashlight_white :D
Last edited by dark0r on Thu Oct 28, 2010 3:49 pm, edited 2 times in total.
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users