PDA

View Full Version : RPC technology - how to fake it (maybe)


Pavlov
09-16-2003, 04:58 AM
Hi all,
i'm working on a large scene with hundreds of trees.
3D trees are to heavy, and simple mapped planes are not enough since i need to animate the camera.
So i went out with this trick... it's 90% functioning, maybe someone can improve it, or even make a Lscript to automate the whole process !

- take a 3D tree into an empty scene
- rotate it of 360° in 360 frames (for example), so you get an image for each degree.
- Render the sequence.
- Now, in Modeler create a plane which fots the tree and UVmap it. Map the first rendered tree on it.
- In modeler, clone the plane and rotate it of 1°, keeping the trunk as rotation center. UVmap this plane with another name (this will be useful when we'll apply clip maps in Layout) and assign it the second map.
- Do it for each map; you'll end with 360 spinned poygons. BTW, after 180 you'll need to slightly move polygons to avoid overlappings.

- Now go to Layout. Here come the problem. Well, i need to make each plane totally transparent or dissolved if camera incidence is >1. this way, you'll always see tha plane directed toward the camera, and if you move around the tree it should look nearly 3D.
The problem is: Dissolve channel has not a Texture; Clip map has gradients, but there's not a "camera incidence" parameter; Transparency should work, but we'll go far beyond LW's 24 transparency planes.
The second problem is memory: 360 tree maps (with 32bit each) need a huge amount of memory. Maybe someone can come out with a solution... like transforming the sequence into a movie.. dunno.

If we solve these, we should have a good compromise between 2D and 3D trees.

Let me know
Paolo Zambrini

Pavlov
09-16-2003, 05:09 AM
Anoter solution: we can work with just a plane targeting the Camera; here, we should have an image sequence of trees, and we should find a way to control which map is projected on the plane depending to tree's rotation on H channel. It seems there's not a way to control this directly, maybe a custom Lscript is needed. Let's keep the example with 360 pics; this script should take the absolute H angle af the tree, and put the proper tree map on it... if Tree's abs H angle is 37°, map should be Tree_037.tiff, and so on.

Bye
Paolo

fxnut
09-16-2003, 06:39 AM
I'm pretty sure there used to be a product on the market that did exactly what you're talking about in your second post. Can't remember what it was called though, sorry!

I had a look the other day to see if either LScript or the plugin SDK could specify the current frame of an image sequence or even access the file list of an image sequence, and unless I missed something, I don't think it's possible which is a huge let down by the SDK - shameful! Definitely gonna request this feature.

I think it is possible though to use LScript (or the SDK) to individually load an image into a surface texture layer. But the problem is that you'd want it to work on a per object basis, and not a per surface basis (since all the trees would be sharing the same surface). I'm not sure you could set it on a per object basis using this method.

So that brings me to the only other method I can think of for doing this, and that would be to write a some sort of shader to do it. This would just return the correct pixel colour of the correct image at a certain position and ray incidence angle. This would be dead cool, cause it'd mean that reflections would work properly and stuff would reflect the correct angle from the tree. Also, the shader would be able to dissolve from frame to frame meaning that you'd get a nice smooth transition.

An even better solution for this would be to render the tree frames off at the vertex positions of a tesselated sphere. That way, you'd be able to move the camera around at ANY angle, and it'd work fine! Hmmm nice....

Sounds like a nice little project for those long dark evenings coming up this winter :)

The only other thing that occured to me (for using native Lightwave features) was that you could create a 360 layer surface which had an envelope on the dissolve parameter of each layer that referenced one of 360 expressions to modify it's dissolve depending on the object's orientation. It'd work I'm sure, but it'd take you a month to set it up.... for one tree! I think Lightwave'd probably crash on you way before you managed to duplicate it up to 10 trees. Kinda defeats the purpose huh!


Regards

Andy

HowardM
09-16-2003, 02:49 PM
this all hurts my head , but Im thinking this thread may help in the long run?
http://www.cgtalk.com/showthread.php?s=&threadid=87844&perpage=20&pagenumber=2

so basically I think there is some workaround....to have the opactiy of 360 tree layers turn on/off depending upon camera angle....somehow with expressions or follower...

cool idea!
now make it so!
:)

ckeyes
09-16-2003, 06:33 PM
But wouldn't it be obvious that all the trees
were the same?

I need to do some forest fly-thru stuff myself
and am looking into VUE 4 Pro. Seems to have a lot of very cool features including exporting
scenes back to LW.

Carl

fxnut
09-17-2003, 04:18 AM
Yes, probably. Especially if you did a fly through.

But if a shader like I described above existed, then you'd be able to randomise the height and width of the trees which would go a long way to adding variance. If you then also added in say 3 or 4 other styles of pre-rendered trees it'd probably be enough to disguise the similarity.

You'd probably only want to do this for trees in the middle to far distance anyway.

trick
09-20-2003, 05:07 AM
Why not just use HD_Instance (http://www.happy-digital.com/instance.asp)