Windlight needs real shadows!
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-04-2007 19:31
I've been looking around in-world and I just can't keep from talking about this pitiful miss. Windlight has some amazing graphics, including real water reflections, a beautiful glow, a very nice atmospheric shader and stunning lightning. Still, it misses one important thing for a complete beautiful graphics; shadows.
And no, I don't mean a black dot under prims and avatars. But real, dynamic and clear shadows over the geometry, like in reality when the sun casts your clear formed shadow on the ground dynamically... an effect added in many games which are even older ones. At least the sun and moon could cast shadows between the prim and sun/moon's direction... or maybe prims with lightning can do that too if Linden wants to add that?
That's a feature that really shouldn't be missed. I really want to purpose this in a place where I know Linden reads it, and since jira is for bugs... where do I put a request for it as a feature? It would be sad if Windlight became the normal SL client without some good shadows first. I know they're not that hard to make and probably don't take so much performance though of course, they would be optional in the Graphics settings.
Also, dynamic lightning (if I called that right for this situation) would just rock too if it was to be introduced. Like... a prim with the lightning option and even the sun/moon would stop casting lightning behind other prims, and create shadows behind obstacles like its normal.
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
12-05-2007 01:58
From: Mircea Lobo since jira is for bugs... where do I put a request for it as a feature? The JIRA is for feature requests as well, however this has already come up: http://jira.secondlife.com/browse/VWR-1601The reason we don't have shadows in SL while older games have them is that in actual games the majority of the shadows are pre-rendered in some way, i.e - they're painted onto a surface manually or automatically using various techniques when a map/level is made. However, in SL this simply isn't possible as the processing cost of pre-rendering shadows is pretty huge if you want it done right. Consider that everything in SL is constantly changing, and you'll see that it's not easy to just re-render shadows all the time, if you put large delays/throttling into it then you may end up with weird effects. For example, the sun/moon move in 10 minute increments which isn't very noticeable since most people don't really look, but if that was happening for the shadows then it would be extremely disruptive as the lighting in a scenes "snaps" every 10 minutes to a slightly different lighting angle.
_____________________
Computer (Mac Pro): 2 x Quad Core 3.2ghz Xeon 10gb DDR2 800mhz FB-DIMMS 4 x 750gb, 32mb cache hard-drives (RAID-0/striped) NVidia GeForce 8800GT (512mb)
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-05-2007 09:02
Hmm I see. Yes, the shadows painted on prims is what I thought of as that's the only way. I thought it could be possible and easy geometry, since it just has to take the geometry of the prim/avatar, stretch it and resize it a bit and turn it into 2D, and make a perimeter where the texture gets darker in that form. In a 2nd case I thought of, it could use the lightning technology it already has though that would lag it a lot at so many casts and it's also kind of blurred. So... just in the way a prim that casts light and the sun/moon create lightning over geometry by brightening the texture and recoloring it where the light beats, all prims could cast a "black light" in the angle between them and the sun/moon/lit-prim. In a 3rd situation, a good idea would be... well this would be interesting; if everything is dark at night (prims, land, avatar, etc) and bright and lit the way it is during daytime... It could make a geometry split in the direction between sun and prim, and have a different day time in that area. So if I have a big box and the sun left of it close to noon, in the right of the box a area of the ground that has the form of the prim is selected, and behaves like its another darker time of day, as that's a form of shadow. Modded a picture to show exactly what my idea is http://img231.imageshack.us/img231/554/ideamu1.jpgThe only thing that would matter now would be the casting understanding, and the understanding that behind a prim, a certain part of a texture must change its color in a certain shape dynamically to be darker. I dunno rendering codes or anything, but I deeply hope Linden will still find a way to add something like this one way or another.
|
Conifer Dada
Hiya m'dooks!
Join date: 6 Oct 2006
Posts: 3,716
|
12-05-2007 09:52
I've posted on these forums several times on just this subject. Real shadows are no. 1 on my SL wishlist. I'm no expert but if it's possible to give us real reflections on water and now, in the latest update of Windlight, what look like proper shadows in tree foliage, surely it should be possible to do real shadows. We have occlusion culling, so it should be possible to configure SL so that light doesn't pass through opaque surfaces too. I can't see how these processes, that are dependent only on the position of a light source, are more difficult than reflections, that are dependent on the postion of the viewer.
It's my guess that shadows are on the agenda for the future SL - how can they NOT be???
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-05-2007 09:59
Yes, another great method would be just the light itsself not passing through a certain shape at all, and making shadows through the removal of the lightning effect behind surfaces. That wouldn't even cause fps lag but on the contrary, reduce it, as that would mean less lightning in total 
|
Kitty Barnett
Registered User
Join date: 10 May 2006
Posts: 5,586
|
12-05-2007 11:14
From: Haravikk Mistral Consider that everything in SL is constantly changing That's overstating things quite a bit. If you look at the grid as a whole I'd think you would find that very little changes completely day after day or week after week, especially if you only consider permanent structures (ie sandboxes don't count) and objects that you'd want shadows for in the first place (ie a house/tree, but not that new picture you just put up).
|
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
|
12-05-2007 11:16
Real shadows require a big load on the client and the computer. It's a lot of math calculating the light intensity, diffusion & angle with the angles of the sides of each each object it hits (think torus & sculpted objects), and accurately projecting that to every object in the shadows path, including the ground, as well as including shadow transparencies that coordinate with each transparent texture (think clothing, plants & trees). It could boot out a lot of poeple who may not be able to afford to have the best system around.
A reflection doesn't have to calculate any angles...it's a 180-degree flipped image of what's above the water, distorted by the same wave that is distorting the water.
In time, shadows will be completely normal in here, but we just have to wait for a couple more iterations of CPU's & Graphics cards to become available to the average user.
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-05-2007 14:01
Like I said, the option would of course be a toggle in the Preferences -> Graphics menu, so who doesn't have enough hardware for it would just turn it off from there. Though such options are tease for some people who want all the details at maximum at maximum fps  Anyway, calculation of the angle wouldn't be the worst CPU eater I believe, though if done in too many places it could get noticed. But I mean... it only calculates a very little pair of numbers. A cube has 8 corners for example, each of them having just 3 axis they lie on. The only maths done here would be calculating the cornets that get in the sun's radius, making the prim's view from the sun's position a 2D shape, filling it and projecting it on the texture behind it stretched. That would mean processing less then 20-25 values every quarter second for the shadow of a single prim... and even older computers processes millions, not a few values like this once every frame and handle it really well. That if I am judging the maths right. Spheres, cylinders, hollow prims and others could indeed be more complex. But if we think about it, how much can it take to just look at a 3D prim from a certain angle, then take a screenshot of it, color everything inside the prim's outer lines in black, then stretch, rotate and schew that shape in a certain position? That's what the computer would do through maths, in a very simple and easy way. So yeah, I just believe resources wouldn't be the worst problem in that case... especially if you can limit a maximum number of shadows / maximum radius for them to appear in. Anyway, a Linden confirmed in that jira request that they plan to add that -later-, so we can just hope that later won't be too late.
|
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
|
12-05-2007 17:45
Cubes arent very difficult, but a torus or sculptie has about 1000 vertices that all would need to be processed in order to be accurate. Its a real monster. Even the maddest sickest games keep them as sparse as possible. I have 4239 objects on 1/4 sim. Each vertex needs to be hit and then processed by up to 8 (not 1) light sources. remember theres the moon, the sun, and up to 6 other light sources. So a torus prim (the standard smoke-test prim), with 1000 vertices, has to have 8000 points calculated at every frame, with the shadow being projected on X number of points of the objects behind it. and this doesnt include the alpha channel processing! The OpenGL technology that SL is based on has to take a few compromise hits, and shadows and ray-tracing in general is one of them. The tradeoff is that we have an immensely easy (yet admittedly controversial) interface to work with wehen we build. Why's that? OpenGL is the choice of most Professional graphics applications--not games but 3D Computer-Aided Design apps. Games don't have real-time building and creation. When they do, youre usually taken to an entirely different interface, and its not real-time. Utilizing OpenGL also allows much more flexibility in the open source world. Anyone can help develop the Second Life client. this means you can start implementing shadows in a future build if you want! -- and I'm sure theres a group of developers already working on that. But in the end, the payoff of flexibility like this is no shadow Ray-tracing (at this time). Now the BEST 3D environments and games utilize an amazing and timeless technology: Artistic Skill. Lets face it, maybe a fraction of a percent of us are formally educated in 3D design & art. Many buildings look flat and dry because they are textured with generic tiles. however, the detailed builders create textures specific to the object, adding shadings and gradients to create a shaded appearance. This is still the technique that's utilized first in the design of any 3D game. Take a look at your walls (in Real Life!) and notice that they darken at the edges and corners. The wall isnt perfectly smooth so you see a lot of shading in the texture on the wall. Taking some time to create a texture that creates the same effect will blow away any ray-traced shadow. MMO's (SL, Warcraft, etc) simply still have to sacrifice immense detail for playability and vastness. LOTR online is the latest MMO and they dont have shadows yet either. but hope is not lost! Moore's law should allow us to have shadows soon. Until then we have windlight to add a bit of depth, and I have embraced it heavily 
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
12-06-2007 02:29
From: Kitty Barnett That's overstating things quite a bit. If you look at the grid as a whole I'd think you would find that very little changes completely day after day or week after week, especially if you only consider permanent structures (ie sandboxes don't count) and objects that you'd want shadows for in the first place (ie a house/tree, but not that new picture you just put up). Okay, sorry, should really have said it more like: "Every single prim in second life is capable of moving at any time". The point is that shadows are very processor intensive things to calculate, and would have to be re-done as things change, that could be a prim door opening, an avatar moving or the sun-cycle changing. It's a crap-load of processing to do!
_____________________
Computer (Mac Pro): 2 x Quad Core 3.2ghz Xeon 10gb DDR2 800mhz FB-DIMMS 4 x 750gb, 32mb cache hard-drives (RAID-0/striped) NVidia GeForce 8800GT (512mb)
|
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
|
12-06-2007 10:39
http://en.wikipedia.org/wiki/Photon_mappingWhen the norm are 256-core CPUs with 512Gig GPU's, this will be possible. Honestly, its not far off.
|
Michael Bigwig
~VRML Aficionado~
Join date: 5 Dec 2005
Posts: 2,181
|
12-06-2007 10:50
Ya...real time shadow casting? That' ain't gonna happen for a few years...at least not in the Second Life client. Other 'metaverses' may create an engine to handle this magnitude of streaming data...and have it optimized...but not SL. Here's an alternate idea, with a few holes in it: they could make it so only certain structures, which have been labeled 'structural', cast shadows. When creating a prim, you select an option in the 'object' section of it's preferences: 'detail' or 'structural.' When placed, and 'locked', the engine knows it's a structural prim, and calculates the shadow placement, and bakes it into the surrounding. Detail prims won't cast these shadows. Now...bare with me. Here are some holes in this idea. Real time shadows should be calculated by the suns position. This means the shadows must move to be believable. This would require baking a dozen different shadow positions. Another thing is color and multiple light sources. What about a street lamp? This is clearly a light source, and if the sun casts shadows by day, this lamp should cast shadows at night...here many problems are presented...multiple light sources (which could be locked to the 6 nearest to you like it is now) are a major hardware strain, especially if there are shadows linked to them. And if we are talking about 'real time' shadows...we must then delve into AV shadows...casting and receiving shadows from any number of light sources. That's another huge difficulty...both in programing, and optimization. Also, self shadowing is necessary for realism. If a structural prim shadow cast a shadow over another prim, this prim must receive this shadow, or else it would seem to have 'full bright' on. Think about it... Lastly, real time shadow casting is a huge hardware strain. If abused (which it will be due to our free-form world creation), it would take the newest hardware to run all these 'real time' calculations. All of these things are only a FEW of the complications 'real time' shadow casting creates--there are many more on top of this... OK, I'll shut up now...you guess get the drift. 
_____________________
~Michael Bigwig __________________________________________________Lead Designer, Glowbox Designs 
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-06-2007 17:05
I see everything well, but still... Firstly, they don't have to make the lit prims cast shadows yet, just the sun and moon cuz its most noticeable. Also, there are games from years ago like Half-Life 2 that cast shadows well (if I remember well and hl2 had that). Also if any of you played DeuxEx 2 Invisible War, you remember in the last map of the game in the ruins... there are these burning barrels there and the way they project that fire together with the barrel on the walls and even when you flip the barrel the light projects through the holes in it perfectly... it just looks amazing.
Even GTA San Andreas has dynamic shadows *laughs* well they are in the same direction there no matter where the sun is facing, but still they are there. And if you ever played something from Gpotato like Flyff or Rappelz, you'll see great dynamic shadows there too. Or wait, let's go back even further. Remember in the old days, games like Drakan or Kingpin Life of Crime? They're old games from 6-7 years ago, by the time DirectX 7 was the latest. And even *they* have perfect dynamic shadows, as amazing as it sounds.
And you think that casting the shadows takes so much CPU? Look at the Need for Speed series since Underground until now, at the reflection detail on cars for example. They take a screenshot every frame at the maximum "reflection update rate" to update the reflection which is perfectly real from the surroundings. And the image is also bended, skewed and resized. If I run NFS U2 with *all* details at maximum now including that, it works perfectly. So no matter what the SL engine uses, it has to have a way this can be added in, I still believe.
|
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
|
12-06-2007 17:19
dont mean to be a Nancy Negative here  , but the games listed follow strict guidelines for amount of objects per space, and all the games listed are ones designed to pass thru the spaces at high speed, not to hang out on a couch and chat. Racing games have very few objects other than the cars. If you stop the car for a moment, youll see that all the buildings are nothing more than squares with very well-done textures on them. Also, none of these games allow for user-created content, the biggest factor that SL engineers have to consider. The developers of these games were very careful in the placement of the objects so they work well. SL doesn't have this luxury. In short, yes, it can be done, but even the fastest computers short of Blue Gene will end up getting a lag of about 1 FPS. Check out some other MMO's and not 1st-person games. Youll see a difference in the way graphics are processed. EVE Online just upgraded their graphics engine, and they always win the "Best Graphics" award. Youll see even in this situation, if the game is described as "massive" at all, shadows are usually not present, at least in a realistic way. Eve is absolutely stunning in its imagery, but shadows are only there for certain situations when the CPU isnt needed for anything else. PS: Im not promoting Eve online, i sucked so bad at that game i had to abandon it  brutal! im too much of a hippie, i guess
|
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
|
12-07-2007 02:13
From: Mircea Lobo I see everything well, but still... Firstly, they don't have to make the lit prims cast shadows yet, just the sun and moon cuz its most noticeable. Also, there are games from years ago like Half-Life 2 that cast shadows well (if I remember well and hl2 had that). Also if any of you played DeuxEx 2 Invisible War, you remember in the last map of the game in the ruins... there are these burning barrels there and the way they project that fire together with the barrel on the walls and even when you flip the barrel the light projects through the holes in it perfectly... it just looks amazing.
Even GTA San Andreas has dynamic shadows *laughs* well they are in the same direction there no matter where the sun is facing, but still they are there. And if you ever played something from Gpotato like Flyff or Rappelz, you'll see great dynamic shadows there too. Or wait, let's go back even further. Remember in the old days, games like Drakan or Kingpin Life of Crime? They're old games from 6-7 years ago, by the time DirectX 7 was the latest. And even *they* have perfect dynamic shadows, as amazing as it sounds.
And you think that casting the shadows takes so much CPU? Look at the Need for Speed series since Underground until now, at the reflection detail on cars for example. They take a screenshot every frame at the maximum "reflection update rate" to update the reflection which is perfectly real from the surroundings. And the image is also bended, skewed and resized. If I run NFS U2 with *all* details at maximum now including that, it works perfectly. So no matter what the SL engine uses, it has to have a way this can be added in, I still believe. The engines behind the games you've mentioned can't create all the shadows automatically. The world designers had to manually add the shadows themselves. They did this by baking the shadows into the textures, or they create special scenarios like the barrel you mentioned. There's very few engines that will create *all* the shadows for you, and even then its done in very controlled way. CryEngine 2 is the only engine I know of that could do what you're asking. But that engine has only just been released and I'm guessing only 10 percent of the SL's residents have a computer that could handle it. There is a way to add shadows to SL, but to keep performance high, they'll be quite clumsy and so will need to be controlled. And when that day comes - there'll probably be ten thousand residents complaining that their next door neighbors big building is casting a big ugly shadow across the front of their lovely home. Shadows are evil griefers that ignore all ban lines. It raises the question - Should shadows on our prims be opt in or opt out? Or maybe: "Avatar x requests permission to cast the shadow from their big fat ass onto your pretty like face. Do you accept?"
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-07-2007 04:14
Ah about already-made shadows; here's another idea - The map of a sim (texture that appears on the main map for a sim) screenshots itsself once a day, right? So, maybe every prim you move or create could get a low-quality screenshot that takes little bandwitch from above once every... let's say 1 minute, that will be colored and the texture will be projected, and only skewed, resized, rotated and recolored accordingly to the sun's position. What do you think?
|
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
|
12-07-2007 08:02
From: Mircea Lobo Ah about already-made shadows; here's another idea - The map of a sim (texture that appears on the main map for a sim) screenshots itsself once a day, right? So, maybe every prim you move or create could get a low-quality screenshot that takes little bandwitch from above once every... let's say 1 minute, that will be colored and the texture will be projected, and only skewed, resized, rotated and recolored accordingly to the sun's position. What do you think? This is a little similar to what I've suggested in the other shadow thread. Basically what you're saying is that SL needs to slowly bake the shadows. I think it's possible. Although this method is gonna need a graphics card with tons of memory. Now we just need to find a programmer that will spend a year programming it. Any ideas?
|
Court Goodman
"Some College"
Join date: 10 May 2006
Posts: 320
|
12-07-2007 16:30
From: 2k Suisei There is a way to add shadows to SL, but to keep performance high, they'll be quite clumsy and so will need to be controlled. And when that day comes - there'll probably be ten thousand residents complaining that their next door neighbors big building is casting a big ugly shadow across the front of their lovely home.
haha come to think of it we should find a way to chill out the ban lines before we shade out our neighbors.
|
Tomball Freelunch
Registered User
Join date: 16 Jun 2006
Posts: 9
|
12-08-2007 23:20
In the Second Life wiki (LSL Portal), under the llSetPrimitiveParams function there's a parameter for [PRIM_CAST_SHADOWS] with the description "shadow casting for a primitive".
Linden Labs at some point in it's lifetime added in that object shadow casting feature. Most likely in test phase in the past or maybe even a future planned feature down the road.
Seems like only one of the LL devs could give us details on this little known prim parameter.
|
Mircea Lobo
Registered User
Join date: 22 Aug 2006
Posts: 102
|
12-09-2007 01:29
From: Tomball Freelunch In the Second Life wiki (LSL Portal), under the llSetPrimitiveParams function there's a parameter for [PRIM_CAST_SHADOWS] with the description "shadow casting for a primitive".
Linden Labs at some point in it's lifetime added in that object shadow casting feature. Most likely in test phase in the past or maybe even a future planned feature down the road.
Seems like only one of the LL devs could give us details on this little known prim parameter. That is interesting... I would like to know more. Does that parameter still work?
|
Nargus Asturias
Registered User
Join date: 16 Sep 2005
Posts: 499
|
12-09-2007 22:45
It still compiled and run for sure. But I don' think it do anything for the moment
_____________________
Nargus Asturias, aka, StreamWarrior Blue Eastern Water Dragon Brown-skinned Utahraptor from an Old Time
|
Sabaku Imako
Registered User
Join date: 15 Sep 2007
Posts: 16
|
12-11-2007 13:54
I totally agree!
|
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
|
12-12-2007 02:20
From: Tomball Freelunch In the Second Life wiki (LSL Portal), under the llSetPrimitiveParams function there's a parameter for [PRIM_CAST_SHADOWS] with the description "shadow casting for a primitive". In 1.10 LL added some very basic shadows, but they sometimes appeared "through" things they shouldn't have, this is likely a leftover from them working to fix it (by making it an option).
_____________________
Computer (Mac Pro): 2 x Quad Core 3.2ghz Xeon 10gb DDR2 800mhz FB-DIMMS 4 x 750gb, 32mb cache hard-drives (RAID-0/striped) NVidia GeForce 8800GT (512mb)
|
Day Oh
Registered User
Join date: 3 Feb 2007
Posts: 1,257
|
12-12-2007 02:30
I just got done watching a long video of Philip and Cory showing off Second Life a few years ago... somewhere in the middle of the video, Philip mentioned that graphics cards are heading in the direction of handling everything dynamically, and that is how Second Life viewers will be able to have shadows.
I thought modern graphics cards do dynamic shadowing already, but I guess they can't yet do it for scenes as complex as required by Second Life?
|