Omni-Directional Env_ProjectedTexture

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

Re: Omni-Directional Env_ProjectedTexture

Postby Plague on Mon Aug 30, 2010 7:35 pm

Doom 3 ran awesome on my old comp, That comp probably would not handle Source on its highest settings today...
But damn I had fun in Doom 3...

As far as I can see it seems that Valve tries to keep their user range very large, but nonetheless they'll have to eventually add in full dynamic lighting.
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 Gary on Mon Aug 30, 2010 7:37 pm

MW2 uses both lightmaps and shadowmaps, it looks pretty good. You just need a good balance.
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 Mon Aug 30, 2010 7:38 pm

We need Valve to do it though :(
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 Armageddon on Mon Aug 30, 2010 7:40 pm

Fake Factory 10 uses full dynamic lighting, everywhere, in every level. My comp gets 60 fps, that's pretty good. And we are only talking about dynamic lighting for modders, who cares about VALVe right now, they have the full engine code and a great team, I'm sure they'll find a way to optimize it.

EDIT: Why do you need VALVe to do it? :|
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Mon Aug 30, 2010 7:42 pm

What? Fake factory uses dynamic lighting? I must look into this, I am doubtful of the correctness of that information.
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 Mon Aug 30, 2010 7:44 pm

Ummm

Edit: Hardly full, and Valve could truly implement a full dynamic lighting system if they wanted too.
They want to keep as many possible people in the loop and if that means staying with mostly precomputed lights till (3-5yr old?) comps can handle it.
Fake Factory site wrote:Dynamic Shadows Note:

The dynamic shadows were achieved with the placement of env_projectedtexture entities. Env_projectedtexture entities are omni-directional lightsources without falloff. This entity type is very costly and must be used sparingly and only in the most appropriate areas, where the normal static shadow would break the principle of optics too obviously.

For performance reasons I chose a limit of 3 simultaneous active env_projectedtextures in the players view cone. To avoid some of the numerous bugs with env_projectedtextures (like flickering overlays, light-bleeding through walls or just crashes) I had to place several lightsources different in the maps.

Env_projectedtexture entities are totally unsuitable as a replacement for parallel illumination such as sunlight. For a more accurate sun shadow I used area-triggered shadow_controllers with different angles in addition to the projected textures.

All these together is not the perfect solution, but much better than the old static lighting.

Attention: You must enable HDR, when using the dynamic shadow enhanced maps. (Looks very weird and unnatural in LDR)
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 Gary on Mon Aug 30, 2010 8:01 pm

Env_projectedtexture entities are omni-directional lightsources


What, they must of did that, last I checked it was projective lightsource.
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 MrTwoVideoCards on Mon Aug 30, 2010 8:14 pm

Hey guys, having doing much of the same tests that Garry performed: Having a directional light for each side is mega expensive. Tests maps are perfectly fine to test them for programming, but for real perf issues you really need to drop them into a real map!

First your actively making an RT for each shadow you cast, then your doing extra work for when an object passes, or is within more than 1 FOV of the shadow-map. Likely this is always the case unless the object is some distance, this is always very expensive. I wouldn't recommend omni lights, as not even current gen games have them. They are just way to expensive unless coded properly to be a omni-light, which isn't possible for us modders considering that bit of the code is all gone and missing.
User avatar
MrTwoVideoCards
Monothetic
 
Joined: Thu Aug 02, 2007 11:18 am
Location: IN YOUR SOUL

Re: Omni-Directional Env_ProjectedTexture

Postby Plague on Mon Aug 30, 2010 8:21 pm

8 years from now we'll marvel in the glory of voxels....
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 Hollow on Tue Aug 31, 2010 12:15 am

Pah, that sucks, I didn't think the 6 lights method would work. Thanks for trying Gary.
I knew it has to be coded in, as this person in the video I linked managed it. But it's for a mod and they wont' want to share their secrets. I can try and contacting them. But no guarantees.

There is too many .cpp files that refer to each that I'm not sure which one i would change to create the desired effect.
User avatar
Hollow
Ubisoft/Monothetic
 
Joined: Thu Aug 14, 2008 12:38 pm
Location: London, UK

Re: Omni-Directional Env_ProjectedTexture

Postby Bites on Tue Aug 31, 2010 1:13 am

Hollow wrote:There is too many .cpp files that refer to each that I'm not sure which one i would change to create the desired effect.


None of them. (However you might want to take a look at imaterialsystem.h if you want to make the shadows less blurry)

Make a 256x256 pure white VTF with a 2px black border to use on the projected textures, and set r_flashlightscissor to 0 and mat_depthbias_shadowmap to 0.00001 and mat_slopescaledepthbias_shadowmap to 2. With these settings, there are no graphical artifacts when using multiple projected, and the shadows almost ALWAYS start where they're supposed to start, instead of 5 feet away from where they should when using distant lights.

Contact me over steam by adding lul45 if you're interested in learning any more, but I can't guarantee I can solve EVERYBODIES problems. I probably will be able to, though, when I get the clientshadowmgr.cpp from 1/4 life (He's moving so hasn't had a whole lot of time to work on it.)
Bites
Dumpling
Dumpling
 
Joined: Thu Aug 19, 2010 8:32 am

Re: Omni-Directional Env_ProjectedTexture

Postby Armageddon on Tue Aug 31, 2010 11:29 pm

I couldn't add you ons steam for some reason, but the flash light is getting cut horizontally when I look down.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Omni-Directional Env_ProjectedTexture

Postby Gary on Wed Sep 01, 2010 4:18 am

You try setting r_flashlightscissor to 0?
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 Armageddon on Wed Sep 01, 2010 4:43 am

Yes I did that.
User avatar
Armageddon
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Sun Dec 14, 2008 5:53 am

Re: Omni-Directional Env_ProjectedTexture

Postby Welsh Mullet on Thu Sep 30, 2010 6:20 pm

What i thought up was, after looking at the realistic muzzle flash code:
Create a new entity which is basically a d_light.
Now i don't know if these just light the world and models or actually cast shadows, but it's worth a try.
That's what she said.
User avatar
Welsh Mullet
Regular
Regular
 
Joined: Mon Jul 12, 2010 10:37 am
Location: Reading... Or sometimes Wales for the weekend.
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users