Faking object shadows

Everything Element 3D belongs here

Faking object shadows

Postby Rob Neal on 07/18/2012, 4:23 am

As it seems Element cannot do raytraced or mapped area shadows at this stage, I have found something of a workaround. It's not brilliant, but it stops objects 'floating in space'.

You need to create a pretty large floor surface, preferably as a thin box rather than a plane, and then create a copy of the base of your object. Crop the object so it only needs to be the lower edge. It can be relatively low poly and just a minimal height. Merge your shadow base and the floor box into a single object and apply a new material, (anything you like), and name it 'Shadow' or whatever. Remember, Element imports material groups, not objects.

Max.jpg

Export the entire file into .OBJ or .C4D, depending on your 3D app and import into Element.
Add/configure whatever textures and materials you need and apply the Element Matte_Shadow Preset material to your shadow layer. I find it best to set the viewer background colour to white, and make sure 'Show AO' is switched on in the top right of the preview window.

Scroll down to the Render Settings>Ambient Occlusion tab in the effects controls window and tweak them accordingly. I have mine set to these. You might need to noodle with them slightly to get the desired intensity. Just go easy as the AO affects the entire model, not just the cast shadow:

Element.jpg
Element.jpg (60.79 KiB) Viewed 10799 times

and you get something like this:

LAPTOP.jpg

It's no replacement for the real thing, and it's a faff to add the extra object, but it works. :)
"Experience is what you have after you've forgotten their name. - Milton Berle"


http://www.robneal.co.uk
Rob Neal
 
Posts: 7164
Joined: 09/30/2008, 4:29 am
Location: London, England

Re: Faking object shadows

Postby Dustin Hudson on 07/18/2012, 9:13 am

Good tips Rob!
You can also do this by just taking the plane from the primitives folder in Element, set it to group 2, check the "matte shadow" switch in materials, and scale the plane to your preferences. Turn on Ambient occlusion and position accordingly. Then you can move your model in group 1 freely and you don't have to export all your models with planes under them ;)
Dustin Hudson
VC Administrator
VC Administrator
 
Posts: 1043
Joined: 11/16/2010, 11:37 am
Twitter: Dustinhud

Re: Faking object shadows

Postby Rob Neal on 07/19/2012, 7:25 am

Dustin:
Actually, Matt Kramer told me about this trick and I tried it, and it works, but strangely, not as well.
There seems to be a strange aberration in the shadow areas I just cannot seem to get rid of. Maybe Andrew might like to do a little tut on this because I think I might be missing something.

It would be helpful if the manual went into a bit more detail about exactly what all these parameters do.

Untitled-1.jpg
"Experience is what you have after you've forgotten their name. - Milton Berle"


http://www.robneal.co.uk
Rob Neal
 
Posts: 7164
Joined: 09/30/2008, 4:29 am
Location: London, England

Re: Faking object shadows

Postby Dustin Hudson on 07/19/2012, 12:22 pm

Hmm... thats strange, are you using the plane from the primitives folder? If its a different model, something maybe seems off about the smoothing groups or polys. Maybe export it as triangles instead of quads (obj export settings).
Also in Element, try bumping up the sample quality of the AO. This will make it a bit slower, but it will increase the quality. But my bets on the first one... (for now)
Attachments
samples.JPG
Dustin Hudson
VC Administrator
VC Administrator
 
Posts: 1043
Joined: 11/16/2010, 11:37 am
Twitter: Dustinhud

Re: Faking object shadows

Postby TomPietrowski on 07/19/2012, 1:15 pm

Yeah seems a bit of a strange work flow rob, I usally have a plane, or thin box on group 3 which works very well for the shadow of objects on that layer. As yet I have not run into your issue. The only time I found problems with it was using an OBJ sequence, on multiply layers of element, but even then so long as the plane was on group 3 of all layers it worked ok.
TomPietrowski
 
Posts: 1280
Joined: 11/18/2008, 3:55 am

Re: Faking object shadows

Postby Rob Neal on 07/20/2012, 5:26 am

If you notice my previous comments, I am already exporting using triangles, and set a AO sample rate of 64. I wasn't aware OBJ's exported smoothing groups.
"Experience is what you have after you've forgotten their name. - Milton Berle"


http://www.robneal.co.uk
Rob Neal
 
Posts: 7164
Joined: 09/30/2008, 4:29 am
Location: London, England

Re: Faking object shadows

Postby klaus brandenburg on 07/22/2012, 6:15 am

Another way to fake shadows:

too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby sebasvideo on 07/22/2012, 9:45 am

klaus brandenburg wrote:Another way to fake shadows:



So how was it done? I see your description in the actual Vimeo page that doesn't show here, and I get an idea, but a step by step would be great.
sebasvideo
 
Posts: 148
Joined: 07/13/2012, 9:57 pm

Re: Faking object shadows

Postby Maxweel on 07/22/2012, 12:41 pm

Hi guys,

I posted about shadows today but my post hasn't been check by the moderator yet. I just made a script to allow Element 3D to cast CS6 ray-traced shadows, you can find a demo here: [youtube]tube.com/watch?v=8VbE4PgGGzQ[/youtube]
I'll check my script and then I'll post a link to download it, unless VideoCopilot actually agrees to add it to their script list.

Max
Maxweel
 
Posts: 704
Joined: 03/12/2012, 8:21 am
Location: Ipswich, UK

Re: Faking object shadows

Postby klaus brandenburg on 07/22/2012, 3:48 pm

sebasvideo wrote:So how was it done? I see your description in the actual Vimeo page that doesn't show here, and I get an idea, but a step by step would be great.


This is pretty straightfoward.

1. Create an Object in E3D.
2. Autotrace this layer to get another masked layer which will generate the shadows later.
3. make this layer 3d and under shadow options select "shadow only"
4. create another 3d layer and set it up as a floor.
5. create a light and a camera. now you should see the shadow. if not, check if the floor layer is set to receive lights and shadows.
6. tweak the position of your masked clock layer until the shadow matches the Elements object. adjusting z and maybe y position should do the trick.

Limitations: you shouldn't distribute lights more than 180°. It has to come roughly from the same direction. Light from the front and the back might look awkward because your shadow layer doesn't have the depth of your model.
too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby Faust on 07/22/2012, 6:31 pm

klaus brandenburg wrote:Limitations: you shouldn't distribute lights more than 180°. It has to come roughly from the same direction. Light from the front and the back might look awkward because your shadow layer doesn't have the depth of your model.


This is actually quite brilliant! Similar to my idea, but with a 2D layer. Much easier than my idea too, even though it doesn't allow for too much perspective change or animation.
I have dual citizenship with the United States and Florida.
Faust
 
Posts: 1762
Joined: 07/29/2009, 12:56 pm
Location: Palm Harbor, FL
Twitter: https://twitter.com/Zeke_Faust

Re: Faking object shadows

Postby Maxweel on 07/23/2012, 2:26 am

Funny that Klaus posted this yesterday, I also posted yesterday a link to a demo I made using the same trick:

But while Klaus places the shadow casting layer manually I used expressions to place the caster properly. I automated everything in a script (made available yesterday, so tell me if you encouter any problem), here is a short tutorial:

1) Build a scene with a room or walls. You can see that I have 6 walls to make a box, a camera and a spot light (it has to be a directionnal light for the moment), and an Optical Flares layer to make a pretty light:
Image

2) Make sure that the materials accept shadows and the light casts them. Use a Shadow Diffusion of 0 for your light, you'll adjust it along with the settings of the shadow composition later

3) add on top of the 3D scene a layer with Element 3D:
Image

4) select the light and the Element 3D layer and launch the script:
Image

5) the shadow appears a bit like magic:
Image

Now for the features:
- the shadow is linked to the light, so if you move the light, the shadow updates.
- the shadow is built from a depth pass rendered by Element, so the objects closer to the light cast a darker shadow.
- you can create one shadow caster per light

However:
- for the moment this is for spot lights only (you can fake any other type of lights with a couple spot light though, making this trick work for point or ambient lights would require many copies of the Element layer, which would make the composition rather complicated and may slow down rendering)
- you can get clipping of the shadow if the light is too close to the object, in this case you need to increase the dimensions of the shadow comp and its layers until the whole object is visible in this comp.
- once the shadow is created, it uses a copy of the Element 3D layer you made. So if you change the settings in Element 3D you need to delete the shadow comp and re-run the script. Basically, you should use the script once you're happy with you Element layer.

Suscribe to the RSS feed on this page to be notified of updates, contact me for any bug:
http://www.schiresk.com/afx/
Last edited by Maxweel on 07/28/2012, 5:09 am, edited 4 times in total.
Maxweel
 
Posts: 704
Joined: 03/12/2012, 8:21 am
Location: Ipswich, UK

Re: Faking object shadows

Postby klaus brandenburg on 07/23/2012, 12:04 pm

Maxweel wrote:Hi guys,

I posted about shadows today but my post hasn't been check by the moderator yet. I just made a script to allow Element 3D to cast CS6 ray-traced shadows, you can find a demo here: [youtube]tube.com/watch?v=8VbE4PgGGzQ[/youtube]
I'll check my script and then I'll post a link to download it, unless VideoCopilot actually agrees to add it to their script list.

Max


Hi Max,

kind of strange that I can see your post with the tutorial only on the mobile site of VC but in the desktop version it's not visible. maybe one of the admins might take a look at this.

anyway. I tried your script but was not sucessfull with it. I set up a scene with a floor and a wall (both receiving lights and shadows), created a light (casting shadows), created a E3D model, marked Elemet and light layer and ran your script (v1). It then created a precomp with my light (+ expressions) and a copy of my elements layer. this precomp was positioned just before my light but I couldn't see any shadow on wall or floor. I tried this with different light positions (deleted the precomp and started the script again) but wasn't able to see any shadow.

appart from this I find the AEs raytracer quite slow and might stick to my workaround. can you imagine, writing a script for the classic renderer?
too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby Maxweel on 07/23/2012, 12:59 pm

Thanks for trying the script. I usually sign Max in forums (old nickname) but you know by now that my name's Kevin so let's forget about Max.
So first, even though I wrote that the ray-tracer renderer should be selected it seems to works fine with the classic one. I only wrote to use the ray-tracer rendere because I'm not fully aware of the features of the classic renderer and feared something would be missing.
Now why doesn't it work? Did you have any 2D layer below your light layer or was it only 3D layers? Normally, the script should create the shadow comp BELOW the Element layer, because if any 2D layer is placed below a 3D layer it sort of "cuts" the 3D rendering.
Could you send me your After Effect project so that I can have a look?
Kevin
Maxweel
 
Posts: 704
Joined: 03/12/2012, 8:21 am
Location: Ipswich, UK

Re: Faking object shadows

Postby klaus brandenburg on 07/23/2012, 2:33 pm

[quote="Maxweel"
Now why doesn't it work? Did you have any 2D layer below your light layer or was it only 3D layers? Normally, the script should create the shadow comp BELOW the Element layer, because if any 2D layer is placed below a 3D layer it sort of "cuts" the 3D rendering.
Could you send me your After Effect project so that I can have a look?
Kevin[/quote]

I have it working now. Didn't realize that I have to adjust the distance slider to match my 3d objects. Pretty awesome :) I wish I had some scripting skills to make my ideas reproducable. If I understand your script right it works fine for objects that are in the same depth zone. objects that are in the same elements group but are in front or behind another object will not displayed right and I have to chose or setup another copy of the created layer with different slider settings, right?

I guess I will go for a mixture of both our techniques. sationary objects are fine with shadow layers and your script is perfect for moving parts.

let's see if andrew can top this with E3D v1.x ;)
too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby Maxweel on 07/23/2012, 3:00 pm

Ok, thanks to Klaus we found the issue, for an up-to-date version of my script use this link: http://schires.franceserv.fr/Element%20Shadow.jsx
I just wanted to point out that all that VC can (and should) do is add shadow WITHIN Element (particles casting shadows on others). Then if you want Element to cast proper shadows onto After Effect 3D layers it's better to use the shadows built into After Effect as the shadows also affect for example the specular reflections on the 3D layers. And that's what this script does.
Last edited by Maxweel on 07/23/2012, 4:49 pm, edited 2 times in total.
Maxweel
 
Posts: 704
Joined: 03/12/2012, 8:21 am
Location: Ipswich, UK

Re: Faking object shadows

Postby klaus brandenburg on 07/23/2012, 4:36 pm

Got it to work and it's awesome. Everybody save your time and download Kevins script. Remember to set your lights shadow diffusion to 0 as a starting value. from there you can tweak with diffusion + the distance and smoothing sliders inside the script generated layer.

@ andrew kramer: as long as you haven't implemented a better shadow function, please support kevins script since this is a huge timesaver.
too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby xtimedt69 on 07/23/2012, 5:47 pm

Maxweel wrote: If you change the settings of Element in the main comp you need to delete the shadow comp and re-run the script, the copy of Element in the shadow comp won't update.


Max,

WOW this works with multi groups too.

In my original Elements comp I created 3 expression controllers for angle X,Y,Z, then pick whipped the rotation of the original Elements and then your Element Shadow ... (you can pick whip across comps) now I can use the expression controllers for rotation of my model and the shadow updates.

I wonder if you could write your scrip to automatically create those parts:
1 - null object with 3 angle controllers 1 each for x, y and z Rotation
2 - pickwhip the corresponding parameter from each element copy.

It could get rather complex when you have multi groups, but it does work in my initial tests.

You think there is any way to get this to work with a point light?
xtimedt69
 
Posts: 18
Joined: 07/14/2012, 6:22 am

Re: Faking object shadows

Postby Maxweel on 07/23/2012, 6:19 pm

I was thinking about linking all the parameters of the copy of Element to the original Element layer. This way updating the parameters (not the models however) in the main layer will cause the shadow to update.
I think it's a better solution than what you propose as it would then allow you to control each parameter the way you want, and not to be limited to a NULL object as controller. Basically you would link any of the settings of your element layer to whatever you want and everything will be cascaded into the shadow comp.
The problem is that as Element is rather complex: it has many parameters sharing the same name, for the moment only a few settings are linked between the original Element 3D layer and its copy, for the ones that aren't for the moment you'll have to do it manually; you can simply copy the expression from a setting that had an expression added by the script (don't forget to change the name of the setting in the expression though).
You may need to re-download the script, check it regularily to see if the version or the comments at the top of the file changed, and if you could give me some feedback on the issues/bugs that'll be great.
Kevin
Last edited by Maxweel on 07/24/2012, 6:36 am, edited 1 time in total.
Maxweel
 
Posts: 704
Joined: 03/12/2012, 8:21 am
Location: Ipswich, UK

Re: Faking object shadows

Postby xtimedt69 on 07/24/2012, 6:30 am

Max,

I may be doing something wrong, but I have had no success at being able to directly link Element Parameters to one another. I tried an experiment where I created a copy of my Element layer and reversed everything in the copy to make a reflection, when I pick-whipped the rotations of the copy to the rotations of the original nothing happened, I could only get the rotations to work together by using a nul with expression angle controllers.

Dave
xtimedt69
 
Posts: 18
Joined: 07/14/2012, 6:22 am

Re: Faking object shadows

Postby klaus brandenburg on 07/24/2012, 7:07 am

Different Topic but I know exactly what you mean since I stumbled across the same problem (viewtopic.php?f=42&t=89669) when I played with fake reflections. Problem is, that both replicator and particle rotation values only deliver the value 1 if they get pickwhipped. you can visualize this if you create a text layer and pick different Element parameters. most of them work fine but rotation seems to be a different beast. best thing I know so far is to create a null object and let it do the rotation for both instances of element.
too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby xtimedt69 on 07/24/2012, 7:42 am

Klaus,

We seem to have discovered this at about the same time! :D But it is easily fixed with a null.

as an aside, and connected to this thread, is it just me, I find controlling spot lights more difficult than cameras.

Dave
xtimedt69
 
Posts: 18
Joined: 07/14/2012, 6:22 am

Re: Faking object shadows

Postby klaus brandenburg on 07/24/2012, 8:10 am

xtimedt69 wrote:Klaus,

We seem to have discovered this at about the same time! :D But it is easily fixed with a null.

as an aside, and connected to this thread, is it just me, I find controlling spot lights more difficult than cameras.

Dave


yeah, first thing I do with a camera or light is to turn auto orient off. should be a way to set this to default.
too many clowns - not enough circuses
klaus brandenburg
 
Posts: 1497
Joined: 07/11/2012, 4:51 pm
Location: Munich / Germany

Re: Faking object shadows

Postby xtimedt69 on 07/24/2012, 8:22 am

I just created a new spotlight to test .... how do I turn auto-orient off?
xtimedt69
 
Posts: 18
Joined: 07/14/2012, 6:22 am

Re: Faking object shadows

Postby dqhoward on 07/24/2012, 9:52 am

I was doing a scenewith spotlights and couldnt get them looking right.
Confused me silly, so I tried a setup with an AE 3d plane and an E3d plane
It appears E3d's renderer treats the cone-angle as twice as wide as the value.
So it looks wrong when combined in a scene :(
emailled support with screenshots "proving" this and and aep too, but have yet to hear anything back.
Hopefully it will be fixed in a patch...

EDIT: attached the trivial project demonstrating this. I use CS5.5.
Do the light circles match in CS6?
Attachments
SpotLightTest.aep
(346.73 KiB) Downloaded 188 times
dqhoward
 
Posts: 37
Joined: 01/31/2012, 11:29 am

Next

Return to Element 3D