Tutorial - Adding realistic shadow inside SL
|
Jimmy Thomson
Bedazzle Team
Join date: 16 Sep 2003
Posts: 50
|
10-14-2004 08:25
Hi everyone, Here is my solution is integrate realistic shadow inside SL without compromising the rendering speed. In this example you can see the shadow projected by a tower on the wall of a castle, this shadow effect cost is only 3 additionals prims and a tiny shadow map of 32x64 pixel. The solution : 1. Place the camera at the location where the light is comming from. 2. Add a green plane behind the object to make life easier in photoshop and take a snapshot. Snapshot of the object from the light location 3. Using your favorite drawing program (Photoshop, PSP...), create an alpha texture that will be your 'shadow map'. 3.1. The Red/Green/Blue channel is not important, 100% black will be ok. 3.2. Create the Alpha channel using the snapshot you made in the previous step. Turn the background to black, the object to white. 3.3. Decrease the size of the image depending of the sharpnest you want in your shadow (128x128 is a sharp shadow map, 32x32 is a blurry shadow map). Shadow map created inside Photoshop (this is the alpha channel) 4. Import your new shadow map and apply it to a plane. 4.1. Create a plane using a plannar box (thickness = 0.01) with all face transparent. Place the shadow map on the main face of the plane. 4.2. Finally, lay down your plane on the ground (or the wall) as a decal, and refine the position to get the realistic shadow. Final Result Comments and critics welcome, good luck! Edited : Another view of the same sceneEdited : Winter Castle - Example of shadow on a bridge structure
|
Almarea Lumiere
Registered User
Join date: 6 May 2004
Posts: 258
|
10-14-2004 08:56
You are a genius, Jimmy!
|
Olympia Rebus
Muse of Chaos
Join date: 22 Feb 2004
Posts: 1,831
|
10-14-2004 09:03
Way cool! Thanks for posting! From: Jimmy Thomson Hi everyone, Here is my solution is integrate realistic shadow inside SL without compromising the rendering speed. In this example you can see the shadow projected by a tower on the wall of a castle, this shadow effect cost is only 3 additionals prims and a tiny shadow map of 32x64 pixel. The solution : 1. Place the camera at the location where the light is comming from. 2. Add a green plane behind the object to make life easier in photoshop and take a snapshot. Snapshot of the object from the light location 3. Using your favorite drawing program (Photoshop, PSP...), create an alpha texture that will be your 'shadow map'. 3.1. The Red/Green/Blue channel is not important, 100% black will be ok. 3.2. Create the Alpha channel using the snapshot you made in the previous step. Turn the background to black, the object to white. 3.3. Decrease the size of the image depending of the sharpnest you want in your shadow (128x128 is a sharp shadow map, 32x32 is a blurry shadow map). Shadow map created inside Photoshop (this is the alpha channel) 4. Import your new shadow map and apply it to a plane. 4.1. Create a plane using a plannar box (thickness = 0.01) with all face transparent. Place the shadow map on the main face of the plane. 4.2. Finally, lay down your plane on the ground (or the wall) as a decal, and refine the position to get the realistic shadow. Final Result Comments and critics welcome, good luck!
|
Snark Serpentine
Fractious User
Join date: 12 Aug 2003
Posts: 379
|
10-14-2004 09:24
That's gorgeous, and you are a great man for sharing your method.
|
Juro Kothari
Like a dog on a bone
Join date: 4 Sep 2003
Posts: 4,418
|
10-14-2004 10:28
Jimmy, thank you, thank you, thank you for posting this! Your texturing tips are a huge asset to the community! Your work humbles me. 
|
Karma Satyr
Little Tea Pot
Join date: 8 Jan 2004
Posts: 88
|
10-14-2004 10:40
My god, why did i never think of this,
_____________________
Short and Stout! Actually i'm more like a coffee plunger.
|
Ingrid Ingersoll
Archived
Join date: 10 Aug 2004
Posts: 4,601
|
10-14-2004 10:45
My god, how did you ever think of this?
Thanks Jimmy!
|
Spider Mandala
Photshop Ninja
Join date: 29 Aug 2003
Posts: 194
|
10-14-2004 13:53
gotta admit thats pretty clever... good job
*edit* after looking at this a second time, this could be possible with only one more prim by hollowing a cube and cutting it to a 90 degree angle and applying the texture to the inside face, would have to jockey the texture around a little more but its possible.
_____________________
"There's an old saying in Tennessee, I know it's in Texas, probably in Tennessee, that says, fool me once... shame on... shame on you. You fool me, you can't get fooled again." -George W. Bush East Literature Magnet School, Nashville, Tennessee, Sep. 17, 2002
|
Spider Mandala
Photshop Ninja
Join date: 29 Aug 2003
Posts: 194
|
10-14-2004 14:42
alright Ive gone and played with this a bit in world... first of all jimmy thanks for sharing this, with just a little effort and some ingenuity this method can be really powerful...
as I was saying you can place the shadow map on the interior face of a cut cube. Attached is an image of two pointy column things and a light source with shadows using a similar process to jimmy's. The two shadow maps are actually the same alpha texture, but one "shadow box" has been simply cut and left parallel with the walls/ floors, while the one on the right has been top sheared to give the shadow an angle appropriate to the position of the light source. only took two extra prims...
it isnt a super clean or well done shaodw like Jimmy's just a knock out but illustrates the idea
_____________________
"There's an old saying in Tennessee, I know it's in Texas, probably in Tennessee, that says, fool me once... shame on... shame on you. You fool me, you can't get fooled again." -George W. Bush East Literature Magnet School, Nashville, Tennessee, Sep. 17, 2002
|
Zuzi Martinez
goth dachshund
Join date: 4 Sep 2004
Posts: 1,860
|
10-14-2004 21:44
one lil problem is that shadows in the real world aren't black overlays, they're a darker tone of the color they lay on. with some more work (no i'm not going to do it hehe) you could make your RGB channels match the object the shadow is cast onto, instead of pure black. you'll still lose some detail in that object because you're putting color over it instead of changing its color but if you play with transparency it should be ok.
that's an awesome method Jimmy. great work!
|
Planet Mars
Registered User
Join date: 10 Feb 2004
Posts: 159
|
10-14-2004 22:18
Excelent work, I'll be trying this out over the weekend too 
_____________________
Planet Mars
|
Ryen Jade
This is a takeover!
Join date: 21 Jun 2003
Posts: 1,329
|
10-14-2004 22:26
WHOA, its true, SL can look like HL2.
_____________________
From: Korg Stygian Between you, Ryen the twerp and Ardith, there's little to change my opinion here.. rather you have reinforced it each in your own ways IM A TWERP, IM A TWERP!  Whats a twerp? 
|
Jimmy Thomson
Bedazzle Team
Join date: 16 Sep 2003
Posts: 50
|
10-15-2004 07:47
From: Spider Mandala alright Ive gone and played with this a bit in world... first of all jimmy thanks for sharing this, with just a little effort and some ingenuity this method can be really powerful...
as I was saying you can place the shadow map on the interior face of a cut cube. Attached is an image of two pointy column things and a light source with shadows using a similar process to jimmy's. The two shadow maps are actually the same alpha texture, but one "shadow box" has been simply cut and left parallel with the walls/ floors, while the one on the right has been top sheared to give the shadow an angle appropriate to the position of the light source. only took two extra prims...
it isnt a super clean or well done shaodw like Jimmy's just a knock out but illustrates the idea Every trick allowing to reducing prims count is a good idea.  However, as you probably noticed there is limitation with U,V mapping in the interior faces of an hollow section. All the interior faces are sharing the same U,V parameters. I wonder if it could make the task harder to use your trick. From: Zuzi Martinez one lil problem is that shadows in the real world aren't black overlays, they're a darker tone of the color they lay on. with some more work (no i'm not going to do it hehe) you could make your RGB channels match the object the shadow is cast onto, instead of pure black. you'll still lose some detail in that object because you're putting color over it instead of changing its color but if you play with transparency it should be ok. In the following example show that you right about the lost of information in the 'night side' area. From an artistic perspective, I appreciate this 'lost of detail' because its add contrast between the night side and the day side. In other words, the fact that my night side have less detail create the illusion that the day side it more detailled. Day/Night level of details Thx for your feedback! 
|
Nexus Nash
Undercover Linden
Join date: 18 Dec 2002
Posts: 1,084
|
10-15-2004 12:14
Ha cool!
|
Spider Mandala
Photshop Ninja
Join date: 29 Aug 2003
Posts: 194
|
10-15-2004 14:59
From: Zuzi Martinez one lil problem is that shadows in the real world aren't black overlays, they're a darker tone of the color they lay on. to get a technically "correct" shadow, the shadow is a very dark tone of the underlying color's complimentary color. for instance.. a shadow on a green surface would be a very dark red... for a little more on complimentary colors: Complimentary colors From: Jimmy Thomson Every trick allowing to reducing prims count is a good idea.  However, as you probably noticed there is limitation with U,V mapping in the interior faces of an hollow section. All the interior faces are sharing the same U,V parameters. I wonder if it could make the task harder to use your trick. Oh, it without doubt makes it harder. Making everything align properly is much harder especially with oddly angled shadows. Ive played with using two planar surfaces as well as a single hollowed face... they both work, one saves 1 prim and one is easier.... was just an illustration in prim conservation.
_____________________
"There's an old saying in Tennessee, I know it's in Texas, probably in Tennessee, that says, fool me once... shame on... shame on you. You fool me, you can't get fooled again." -George W. Bush East Literature Magnet School, Nashville, Tennessee, Sep. 17, 2002
|
Jimmy Thomson
Bedazzle Team
Join date: 16 Sep 2003
Posts: 50
|
First look of Winter Castle!
10-28-2004 12:46
All, here is a first look of the incomming project from the creator of Sim Horror... Winter Castle - Example of shadow on a bridge structure From: Spider Mandala to get a technically "correct" shadow, the shadow is a very dark tone of the underlying color's complimentary color. for instance.. a shadow on a green surface would be a very dark red... for a little more on complimentary colors: Complimentary colors Its the first time I hear this theory, interesting, but I never noticed that! *now making test of shadow irl trying to see a complementary color*
|
Ariel Roentgen
Simply Me
Join date: 11 Apr 2004
Posts: 345
|
10-28-2004 13:04
oooohh, more tricks to put up my sleeve  I like 
|
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
|
10-29-2004 12:13
From: Spider Mandala to get a technically "correct" shadow, the shadow is a very dark tone of the underlying color's complimentary color. for instance.. a shadow on a green surface would be a very dark red... for a little more on complimentary colors: Complimentary colors Really? I always thought that shadows were the colour of the ambient light (not the direct light). For example, outdoors shadows tend to be blue on sunny days, since the ambient light (the sky) is scattered blue light. 
_____________________
- Making everyone's day just a little more surreal -
Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
|
Beatfox Xevious
is THOUSANDS OF PEOPLE
Join date: 1 Jun 2004
Posts: 879
|
10-29-2004 14:05
From: Zuzi Martinez one lil problem is that shadows in the real world aren't black overlays, they're a darker tone of the color they lay on. with some more work (no i'm not going to do it hehe) you could make your RGB channels match the object the shadow is cast onto, instead of pure black. you'll still lose some detail in that object because you're putting color over it instead of changing its color but if you play with transparency it should be ok. It's true that real-world shadows aren't actually black overlays. However, using black overlays does, in fact, create the same end result as what you describe. If you overlay a color with black (using any alpha value), the resulting color will still be the the same hue and saturation as the original -- the proportions of the RGB values in relation to each other persist. Thus, you really are creating a darker tone of the original color. Note that the same cannot be said for gray or white overlays. Only pure black. From: Spider Mandala to get a technically "correct" shadow, the shadow is a very dark tone of the underlying color's complimentary color. for instance.. a shadow on a green surface would be a very dark red... for a little more on complimentary colors: Complimentary colors I think this is more of a trick used in painting, to achieve a greater color contrast between the lit and unlit portion of an object. The only case where this would be true in real life is if A) the color of ambient light, and/or B) the color of light reflected off a nearby surface (radiosity) was affecting the object.
_____________________
My Beatworks: Zephyr Chimes wind chimes, the KanaMaster Japanese kana tutor, and the FREE Invisibility Prim Public. Look for them at the Luskwood General Store in Lusk (144, 165).
"You have been frozen. You cannot move or chat. A pony will contact you via instant message (IM)." - mysterious system message I received after making off with Pony Linden
|
Brian Livingston
Registered User
Join date: 26 Jan 2004
Posts: 183
|
10-29-2004 22:04
From: someone to get a technically "correct" shadow, the shadow is a very dark tone of the underlying color's complimentary color. for instance.. a shadow on a green surface would be a very dark red... for a little more on complimentary colors: Complimentary colors
Shouldn't the complimentary color of green be magenta is we are dealing with light and not pigments? Blue's complimentary is yellow and Red's is cyan? I think we'd be dealing with additive primaries in this case instead of subtractive primaries. I could be wrong though.... Additive Colors
|
Goshua Lament
Registered User
Join date: 25 Dec 2003
Posts: 703
|
10-30-2004 12:42
Thanks Jimmy! I gave it a try with the infamous plywood cube and here is what I got: http://www.flickr.com/photos/goshua/1146790/
_____________________
Flickr Second Life Photo GalleryI no longer regularly login to SecondLife, but please contact me if an issue arises that needs my attention.
|
Pirate Cotton
DarkLifer
Join date: 26 Sep 2003
Posts: 538
|
10-30-2004 21:50
Those are quite simply stunning results. Jimmy, are you for hire? I could do with some tweaks on the DarkLife sim.
PC
|
Ryen Jade
This is a takeover!
Join date: 21 Jun 2003
Posts: 1,329
|
10-30-2004 22:11
Yes jimmy, I was thinking the exact same thing for tartarus and you. Well, if I can get tartarus running agian!
Edit: Wow, goshua, why didnt you even tell me you took those awsome pics of tartarus?
_____________________
From: Korg Stygian Between you, Ryen the twerp and Ardith, there's little to change my opinion here.. rather you have reinforced it each in your own ways IM A TWERP, IM A TWERP!  Whats a twerp? 
|
Jimmy Thomson
Bedazzle Team
Join date: 16 Sep 2003
Posts: 50
|
11-01-2004 08:03
Pirate Cotton, You'll find my answer on your thread.  Goshua Lament, Cool Goshua, glad to see that ppl can understand my tutorial. You just make a simple test, now its time to try it on a large scale project!! Post your result.
|
Goshua Lament
Registered User
Join date: 25 Dec 2003
Posts: 703
|
11-01-2004 08:20
From: Ryen Jade Edit: Wow, goshua, why didnt you even tell me you took those awsome pics of tartarus?
Huh. I recall IMing you. I'll test the shadow with a set of mine sometime this week.
_____________________
Flickr Second Life Photo GalleryI no longer regularly login to SecondLife, but please contact me if an issue arises that needs my attention.
|