View Full Version : Anyone working with Volume Maps?
EricChadwick 06-23-2004, 04:39 PM I'm creating animated volumetric textures for a real-time 3d rendering system, to create effects like atmospheric smoke. Our system uses bitmaps to construct the volume effect. The volume of smoke is cut up into slices, each slice being an sequence of tiling/looping bitmaps.
I'm looking for some ideas about how to make these textures, if anyone has worked on something like this. Any tools to suggest?
I'm using 3ds max to construct the volumes, and it's working, but it can be tedious to create the slices.
The DDS texture format has a volume texture variation (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/ddsfilereference/ddsvolumetextures.asp). I'm curious if anyone has used NVIDIA's Texture Tools Photoshop plugin to create a volume DDS... does it expect each slice to be a separate Layer?
Thanks for any insights...
|
|
Stroker
06-23-2004, 06:08 PM
I'm not technically savvy in that direction, so I have no idea if this will help.
I've used Mahjqa's Fire (http://www.ozoneasylum.com/4650) (Photoshop + IR) to do some cool animated textures. Fire, smoke, and things that ooze.
Umm... that's all I got, and I don't even know if it will help.
EricChadwick
06-24-2004, 03:14 PM
Thanks for that. Doesn't really help doing 3d textures, but nice to know about.
I figured out how the DDS volume works... has to be a flattened file with each slice next to one another in a wide image file.
I'm wrestling right now with UVW tiling issues. A torus lets me tile a 3d procedural effortlessly across both U and V. But if I move the procedural along Z through the torus, in order to get my W slices, then I get some ugly distortions, since there's really no way to move along W through a torus. So, that's what I'm working on today... a different U/V/W tiling scheme.
Anyhow, probably just a bunch of gibberish.
Stroker
06-24-2004, 06:56 PM
I like gibberish. Gives me something to try to learn about.
Some months ago I was playing with getting a 3d proc to tile in all 3 directions on a an object with out getting funky with mapping channels and gradients. I eventually managed something decent with Falloff > Local XYZ and Towards/Away. I "stacked" 3 Falloff maps for each axis, then used RGB Multiply to get them to play nice. Wait... I think it was the other way around. I stacked an RGB Multiply in another RGB Multiply for 3 fresh slots. In those, I used Falloff. Then, in the Falloff slots, I tossed in my 3d proc. In each Falloff, I rotated the 3d proc 180 degress on the appropriate axis. So, in all 3 directions, the 3d proc tiled x2.
Why I used RGB Multiply is kinda hard to explain. It was so I wouldn't have to divide the normals into 8 different sections using 3 falloffs each. That right there wouuld have been 24 maps before any other maps were used.
Umm... 3DS Max.
Real neat trick if you can understand it, but I don't think it's what you are after.
Sounds more like you are trying to snag the 3d proc from the volume of an object and slap it onto a plane. Like a boolean intersection or something.
Have you tried actually slicing the object in a non-destructive way and rendering that?
You know, like that Project Slice the Frozen Guy thing from some years ago.
They froze a convict, sliced a bit off, and took a photo. Slice another bit off and take another photo.
When they put all of the photos together, they got the volume of the guy and his organs and stuff.
Well, that's my gibberish for the day.
You know, Eric, you are frustrating, but in a good way.
I sincerely do want to help for various reasons, but I'll spare you.
EricChadwick
06-24-2004, 08:26 PM
Haha. Don't spare me! PM me if you like, I'm curious.
The Visible Human Project (http://www.nlm.nih.gov/research/visible/visible_human.html) is very similar to what I'm trying to do. Except I am re-integrating the slices of the 3d procedural into a 3d fog-like effect. Not just a single cross-section, a bunch of them. With this technique, I'm able to convert nearly anything into a volume-fog effect, from geometry to particles to fire fx to whatever.
The Falloff idea is interesting. But how would it tile? I found I can only tile a procedural if I use Render To Texture on a Torus, converting XYZ-space of the 3d texture into the seamless UV-space of the torus. Or I can tile by using gradients (http://www.ericchadwick.com/examples/tiling_an_animated_texture.html) on rendered bitmaps of the procedural. I'm in the process of refining the latter right now.
You don't happen to have a .max file lying around with the falloff setup do you?
Thanks for the blabber.
Stroker
06-24-2004, 11:45 PM
I just wrote a book and lost my post. I'm not happy right now.
Until I cool off, tear this apart: torustilexyz.zip (http://cablespeed.com/~jlhalmich/ozone/torustilexyz.zip) ~33k Max 6.
I'm gonna go kick stuff around.
minor edit:
I'm pretty sure you can move through w and tile/loop it at least once.
I was playing with something similiar and the trick was in using world/object space and explicit mapping channels. Don't know if I can cobble it to your use, though.
Off to kick more stuff.
Stroker
06-25-2004, 01:08 AM
I got it. I'm a genius. At least, I think this is what you are after.
It's all in the Offset.
Stack up a bunch of xy planes along z.
Planar mapping along xz or yz. Or is that x or y?
Diffuse > Mix > Mask > Gradient Ramp.
Tweak the ramp to clearly divide the top from the bottom planes. In my tests, I used black and white at 49 and 51 just to show the divide very clearly.
In in the Colour #1 & #2 slots of the Mix map, toss in the same procedural.
Make sure the procedural is set to Object space. Of course, tweak size.
Now, to clearly see one repetition on the object, you need to know the "up/down" size of the object.
If the object is 100, then the magic number is 25.
In one of the procs, set one of the offsets to 25; and, in the other proc, set the same offset axis to -25.
For some reason, the offset axis in my tests was y. I don't know.
So, when you animate one repetition, the trick is keeping the same difference between the appropriate offset axis.
For one full repetition through the volume, animate proc #1 offset from 0 to 100; and the other proc's offset from -50 to 50. Um, for an object with a height of 100, I think.
As near as I can tell, it's the same basic idea as your gradient trick. Except it's xy plus z. The gradient doesn't have to be tricky because the extra dimension is only one extra dimension. Know what I mean?
Good, or did I totally miss the mark?
edit:
Wow. I made some glaring errors. Heh.
EricChadwick
06-25-2004, 02:09 PM
Wow, thanks for this. I have to get the file over to a friend's machine to open it (only have v5.1 here), then I'll examine. Thanks again, sounds intruiging.
Stroker
06-25-2004, 03:01 PM
Crap. I think I had better clarify (mostly for the public).
The Max file that I posted is totally different from the graphic that I posted shortly afterwards.
The Max file is the RGB Multiply and Falloff trick.
In the Falloffs, I messed with Mix Curve to help keep the material tree managable. Normally I would toss a map in both of the slots, but I opted for Mix Curve for clarity.
Notice that the unused Falloff slot is pure white.
Also, the torus has 3 mapping channels, each one planar from each axis. Not really necessary for a 3d proc, so for the benefit of using a bitmap.
It's a neat trick, but I can't remember what I used it for.
Now, the graphic that I attached is something that I was messing with some months ago. It's an exploratory into the volume of 3d procedurals. I learned some pretty neat things.
I took like 400 planes and stacked them up in one direction real nice and tight. Copied the lot and rotated 90 degrees. Copied the lot again and rotated the other way. Then attached them all together for one massive "cube" object.
The cube of planes has a planar mapping with a gradient tossed in.
White is +z and black is -z.
Even threw in an extra plane to show the gradient next to the cube.
Then it was just a matter of an opacity map.
In the graphic shown, I used Cellular.
Since this is in Opacity, I tweaked the low and high points to kind of threshhold the shades of grey.
What did I end up with?
The volume described by Cellular.
I've also got a few other renders laying around, like Splat, Noise, and Planet.
Pain to render, but fun to play with.
Plus I learned a few things about the fundamental nature of 3d procedurals.
If I ever get my Max tutorials back online, I definitely have a few things to say about all of this.
Now, I suspect that my cube of planes is what you are doing.
EricChadwick
07-01-2004, 05:21 PM
Yes, am doing something like your cube of planes. Except it renders in real-time in our system. The planes are also not so apparent... our system aligns the planes to the view, while keeping the volume in worldspace. Pretty cool.
Anyhow, the torus trick with falloffs doesn't solve my problem. Thanks for the ideas though, I played around with it just now, it's a smart trick. What I'm stuck on right now is how to tile UV but at the same time create Z offsets. The torus lets me tile, but Z offset causes ugly distortions (since the torus tiling is in UV space, while the Z is in world space, so when I move the texture on Z up through the torus it ends up moving in different directions in UV space). Using planar geometry lets me do flawless Z offsets, but doesn't tile.
What I really need is a way to push the 3d texture out along the torus' normals... that would give me the slices, without weird distortions. I could do a W offset on the noise, but that forces the noise to use UVW, which negates the tiling.
So... I'm looking at the planar geometry route, going to try tiling with gradients.
Hrrmmph. Maybe painting this by hand would be easier!
Stroker
07-04-2004, 03:02 AM
Crap. I almost forgot about this.
almost3dtile.zip (http://cablespeed.com/~jlhalmich/ozone/almost3dtile.zip) ~50k Max6
Mapping channel 1 holds planar mapping for the masks.
Two Mix maps with one nested.
Rather than try and animate the offsets, I squished the torus's UV down to 1/3 because I figure it would be easier to animate the UVs themselves.
Umm...
Few more things to note, but I gotta git outta har.
For now, the more important thing to note is that I haven't actually tried to animate.
Stroker
07-04-2004, 06:54 AM
Holy crap. Something is terribly wrong. Until I figure it out, looks like I'm out.
As a consolation, I do have a little something for you: looping Noise. The trick is rotating the second phase at 90 degrees of the first. Plus an offset of Phase 2 doesn't hurt.
Frames 1 - 100
Phase 1 =
Frame 1 = 0
Frame 25 = 1
Frame 50 = 0
Frame 75 = -1
Frame 100 = 0
Phase 2 =
Frame 1 = 13
Frame 25 = 14
Frame 50 = 15
Frame 75 = 14
Frame 100 = 13
Mix Amount is the same as Phase 1, but frequency x2
Mix Amount =
Frame 1 = 0
Frame 25 = 100
Frame 50 = 0
Frame 75 = 100
Frame 100 =0
There is a touch of "doubling-back", but hardly noticable in my tests.
I've got another variation that uses Noise as a mask.
Per-Anders
07-04-2004, 07:26 AM
what you require is a projectpoint function. with most projections (e.g. spherical etc) it's easy, however for raw UV space rather than a standard projection basically you have to do a point plane distance function, project your point onto the plane and work out your uv from there, maybe using barycentric coords. there's plenty of stuff on the net for finding out how to do that, it's just the speed that's important in this case.
of course it's easy for me to say cos i'm using the cinema4d sdk which has all of this stuff built right in (projectpoint etc), but i'm sure you can get this working without too much pain. and your volume rendering project sounds really interesting, would quite like to see how the results look.
DonMeck
07-08-2004, 01:50 PM
I think I really didn't understand what you are trying to do. But just in case you want to create slice textures from 3d objects, what about using an orthographic camera with animated near&far clipping and then render at different frames. I guess a little script could automate the whole thing and even combine all the textures in one texture/image file (which is the DDS format??).
Ignore me if I completely miss the point (I have a feeling that this is the case).
EricChadwick
07-08-2004, 02:23 PM
Thanks for the help everyone.
I ended up using the Material Editor's Render Map feature to setup and render a complex map tree. This got me the procedural noise looping and tiling in all four dimensions. The looping trick was fairly simple... Noise1 phase from 0 to 1, Noise2 phase from 1 to 2, fadeout Noise2 onto Noise1, bump the Output settings in the middle of the fadeout. The tiling trick involved a series of custom gradients, an improved version of the old tutorial I have on my site (http://www.ericchadwick.com/examples/tiling_an_animated_texture.html). Hopefully I'll find some time to update it.
I did do something similar to DonMeck's suggestion, for converting a non-tiling chunk of geometry into a volume texture. I used two animated Slice modifiers along with a Cap Holes modifier. Worked great. Using camera Near/Far doesn't work well for polygons since it leaves holes in the model, although it does work well for slicing particles, for another example volume I made, of a column of smoke rising.
Anyhow, I hope to post some example renderings at some point, once the kinks are all worked out.
CGTalk Moderation
01-18-2006, 02:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.