View Full Version : Shadow Rendering
Blackthorn
30-08-2008, 09:02 PM
Today I was thinking about the way shadows are rendered in games. Now I don't know much about 3D design and development, so this may be a little vague and/or misinformed. Right now, AFAIK, shadows are simply overlays on textures that make them appear darker in the shape of the model they're being cast by and only exist relative to the model (apart from things like self-shadow bump maps). Wouldn't a far more accurate level of detail in shadows be achievable by having the light properly be cast by an object, with obstructions causing shadows naturally as they would in real life? To an even greater degree, properly calculating the intensity of the light and distance of the shadow could stop all shadows having the same sharp or blurry edges.
As I said, I know little about the specifics, but please fill me in if this is being/has been done so I can stop thinking about it.
DEATH eVADER
30-08-2008, 11:09 PM
This is exactly what someone is doing as a project in a HL2 mod. Although currently buggy, it does look promising
KagePrototype
30-08-2008, 11:28 PM
Today I was thinking about the way shadows are rendered in games. Now I don't know much about 3D design and development, so this may be a little vague and/or misinformed. Right now, AFAIK, shadows are simply overlays on textures that make them appear darker in the shape of the model they're being cast by and only exist relative to the model (apart from things like self-shadow bump maps). Wouldn't a far more accurate level of detail in shadows be achievable by having the light properly be cast by an object, with obstructions causing shadows naturally as they would in real life? To an even greater degree, properly calculating the intensity of the light and distance of the shadow could stop all shadows having the same sharp or blurry edges.
As I said, I know little about the specifics, but please fill me in if this is being/has been done so I can stop thinking about it.
I would imagine the problem would be with processing power. The more accurate you're trying to make it, the more cpu cycles it would need to be pulled off. It's often easier to pull smoke and mirror tricks because they're less resource-intensive.
jverne
30-08-2008, 11:51 PM
Today I was thinking about the way shadows are rendered in games. Now I don't know much about 3D design and development, so this may be a little vague and/or misinformed. Right now, AFAIK, shadows are simply overlays on textures that make them appear darker in the shape of the model they're being cast by and only exist relative to the model (apart from things like self-shadow bump maps). Wouldn't a far more accurate level of detail in shadows be achievable by having the light properly be cast by an object, with obstructions causing shadows naturally as they would in real life? To an even greater degree, properly calculating the intensity of the light and distance of the shadow could stop all shadows having the same sharp or blurry edges.
As I said, I know little about the specifics, but please fill me in if this is being/has been done so I can stop thinking about it.
i don't know much either...but isn't there a difference between static and dynamic shadows/lightning?
one is prerendered and one adapts on the situation.
but it's obvious to have real time shadows you need processing power.
Blackthorn
30-08-2008, 11:55 PM
Dynamic shadows still aren't the same as what I'm saying though. They move and skew relative to the position of the light source, but they're still overlays and not actual obstructions of the light. What I'm thinking about is light actually being blocked by the objects, and that's what causes the shadows, so in effect there's no shadow overlay at all, more of a dynamic light overlay. Obviously as KagePrototype said, this would require a hefty amount of processing power.
Vegeta897
31-08-2008, 12:00 AM
You did it Blackthorn. You discovered a completely new technique to rendering lighting in video games. Have it behave exactly like real life! Genius! Pure genius. Why didn't anyone else think of this?
Blackthorn
31-08-2008, 12:01 AM
Your words are poison!
Vegeta897
31-08-2008, 12:04 AM
Guys I just got an even cooler idea.
Why don't we program the AI to have actual brains? Like, just like humans do. That way they would behave perfectly realistically. I think it would work great, instead of relying on scripted sequences and pathfinding and stuff.
Heheh, I'm only having a bit of fun :p
More work to be done on the shader models please.
I can't stand when a nice face is ruined by spazzing, checked shadows.
Blackthorn
31-08-2008, 12:07 AM
Guys I just got an even cooler idea.
Why don't we program the AI to have actual brains? Like, just like humans do. That way they would behave perfectly realistically. I think it would work great, instead of relying on scripted sequences and pathfinding and stuff.
Heheh, I'm only having a bit of fun :p
Yeah yeah I realise it's asking a lot, and it's obviously what developers are eventually aiming for, I just wanna know if there's anyone doing it now.
In the meantime, me and you start out own dev team called BlackVeg to create a perfect, simulated Planet Earth.
More work to be done on the shader models please.
I can't stand when a nice face is ruined by spazzing, checked shadows.
Very much this.
MGS4 did a good job with self shadowing, but came with a sacrifice: pretty lame job at distant shadows.
Vegeta897
31-08-2008, 12:09 AM
We'll cut out all this bullshit work-around rendering techniques and just do it the way nature does it. It's really the best solution.
soulslicer
31-08-2008, 09:59 AM
Dynamic shadows still aren't the same as what I'm saying though. They move and skew relative to the position of the light source, but they're still overlays and not actual obstructions of the light. What I'm thinking about is light actually being blocked by the objects, and that's what causes the shadows, so in effect there's no shadow overlay at all, more of a dynamic light overlay. Obviously as KagePrototype said, this would require a hefty amount of processing power.
Cry engine does that. Incredibly well too I might add.
Tropico
01-09-2008, 12:57 AM
IMO i would prefer the time and money being used for stories and dialogue.
It seems to me that dev teams are now buying 3rd party software (speed-tree,havok etc-) to cut down time on development. Then they can focus on proper IP and not have 6 and 7 games with the same name no variety.
In conclusion i prefer the time and money to be used in diferent aspects of a game.
I want games to substitute movies in 10 years, in in 7th art form.
theotherguy
01-09-2008, 05:09 AM
Today I was thinking about the way shadows are rendered in games. Now I don't know much about 3D design and development, so this may be a little vague and/or misinformed. Right now, AFAIK, shadows are simply overlays on textures that make them appear darker in the shape of the model they're being cast by and only exist relative to the model (apart from things like self-shadow bump maps). Wouldn't a far more accurate level of detail in shadows be achievable by having the light properly be cast by an object, with obstructions causing shadows naturally as they would in real life? To an even greater degree, properly calculating the intensity of the light and distance of the shadow could stop all shadows having the same sharp or blurry edges.
As I said, I know little about the specifics, but please fill me in if this is being/has been done so I can stop thinking about it.
Um, what you're talking about is called ray tracing. It actually came about long before the overlay shadows we use in games today, and is the basis of all modern CGI rendering. One game that uses ray tracing is Doom 3.
http://en.wikipedia.org/wiki/Ray_tracing
http://upload.wikimedia.org/wikipedia/commons/thumb/3/32/Recursive_raytrace_of_a_sphere.png/300px-Recursive_raytrace_of_a_sphere.png
http://upload.wikimedia.org/wikipedia/commons/thumb/e/ec/Glasses_800_edit.png/300px-Glasses_800_edit.png
Blackthorn
01-09-2008, 12:55 PM
Thanks, I can sleep easy now. I guess this'll be what to expect on the next generation.
Kyorisu
01-09-2008, 05:21 PM
http://movies.custompc.co.uk/cpc/images/Veyron_2560_2x2.jpg
http://movies.custompc.co.uk/cpc/images/Veyron_2560_adaptAA.jpg
Quite a way off.
Mikael Grizzly
01-09-2008, 05:29 PM
I wish there'd be less ado about graphics and more about gameplay, story and narration.
Vegeta897
01-09-2008, 05:30 PM
And AI, damnit.
I want the AI in games to shock me like it did when I first played Half-Life.
PvtRyan
01-09-2008, 11:26 PM
Um, what you're talking about is called ray tracing. It actually came about long before the overlay shadows we use in games today, and is the basis of all modern CGI rendering. One game that uses ray tracing is Doom 3.
Doom 3 doesn't use Ray Tracing. Not even remotely the same principle.
http://en.wikipedia.org/wiki/Shadow_volume
theotherguy
02-09-2008, 02:18 AM
Doom 3 doesn't use Ray Tracing. Not even remotely the same principle.
http://en.wikipedia.org/wiki/Shadow_volume
Alright, sorry.
Iced_Eagle
02-09-2008, 03:54 AM
Yup, ray tracing is what you're after. Or rather, as close as you're going to get for now.
It's still not as efficient as rasterization and all of the techniques will have to be reworked.
However, ray traycing will never be the lighting solution in games. It's going to be a mix with global illumination models as well. For example, let's say a designer is working on a scene and he sets up the scene how he wants it, but he wants to get rid of some shadows (to get proper contrast between elements or something). In pure ray-tracing, good luck with that as it would be fairly tough.
I'm actually doing work with lighting and shadow algorithms this semester, so we'll see how it goes.
Saturos
02-09-2008, 06:31 AM
I would imagine the problem would be with processing power. The more accurate you're trying to make it, the more cpu cycles it would need to be pulled off. It's often easier to pull smoke and mirror tricks because they're less resource-intensive.^This
All gfx effects are smoke and mirrors though when you really think about it.
Ten years ago, there's wasn't such a thing as bump mapping and specular lighting.
It was all just plain whitewash (textures) colors painted over a series of wire-framed vectors, plains, and tangents. A few years later, better quality paints with glitter and grits (bump mapping and specular) was created in specification to the current top-end hardware to give an illusion of a more realistic, believable environment(s).
Our current cutting-edge hardware still needs programming shortcuts for the time being to compensate. It's a developing process until it becomes available.
It was the mistake Crytek developers made with Crysis when it was first released. Their techniques were far too ahead of it's time for the current top-end hardware.
I wish there'd be less ado about graphics and more about gameplay, story and narration.^agree
It's seems publishers are more concerned with tech demos than creating an immersive/fun experience these days. Even the games I like anymore falls slighty short off the mark seemingly for this reason.
Iced_Eagle
02-09-2008, 06:46 AM
It's seems publishers are more concerned with tech demos than creating an immersive/fun experience these days. Even the games I like anymore falls slighty short off the mark seemingly for this reason.
Gameplay is something that you either have great or not really. With graphics, it's what helps sell the game and is what is shown to everyone (think of all the times you looked at screenshots. You were basically just looking at the graphics and how good it looked)
Usually you just have a set game design, follow it and tweak it. When you start getting something solid, you have to judge whether what you have is fun or not (most studios do this step way too late in the process). It's sort of treated like a second class citizen at time because nobody really can understand what is "fun". They'll just create the game they designed, and hope it turns out for the best.
Graphics are a lot more concrete and you can tell whether what you've created is good or bad.
Saturos
02-09-2008, 07:35 AM
Gameplay is something that you either have great or not really. With graphics, it's what helps sell the game and is what is shown to everyone (think of all the times you looked at screenshots. You were basically just looking at the graphics and how good it looked)
Usually you just have a set game design, follow it and tweak it. When you start getting something solid, you have to judge whether what you have is fun or not (most studios do this step way too late in the process). It's sort of treated like a second class citizen at time because nobody really can understand what is "fun". They'll just create the game they designed, and hope it turns out for the best.
Graphics are a lot more concrete and you can tell whether what you've created is good or bad.Yeah, but what about user feedback? Forums, blogs, reviews etc?
They can still get a good idea of what gamers like and still incorporate elements from both mainstream opinion and hardcore fans alike so that everbody gets alittle of everything they like from games.
It's not that easy though is it? :p
Iced_Eagle
02-09-2008, 05:58 PM
Yeah, but what about user feedback? Forums, blogs, reviews etc?
They can still get a good idea of what gamers like and still incorporate elements from both mainstream opinion and hardcore fans alike so that everbody gets alittle of everything they like from games.
It's not that easy though is it? :p
Nope, it's not. For starters, if a core gameplay piece is flawed, there's very little chance of being able to go back and fix it to make things fun due to all of the repurcusions it could have on everything already created. For example, if all of a sudden you think that your character would have a much better time if they could fly, that would affect level design, rendering, AI, rethink of the controls, etc... It wouldn't be that difficult to code, but the fact that it would affect sooo many things is what makes it hard.
Nice thing about graphics is that it really only deals with one thing. While it's also a bad thing to change things as you get near the end, it's not as catastrophic usually since most of the time it's just optimization.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.