PDA

View Full Version : Exporting out heightmap from modeled mesh in Lightwave for import to worldmachine?



prometheus
02-03-2014, 06:41 AM
Does anyone know a good method of exporting out a heightmap from a modeled mesh in lightwave, or use another (free tool) that loads the lightwave mesh and then creates a heightmap from it?
Itīs pretty common to export out from worldmachine and in to lightwave, but I havenīt worked with the opposite workflow, and this I would like to do in order to have the artistic freedom of modeling my terrain
in lightwave, then just use worldmachine for adding erosion flows to that, then export back heightmaps to lightwave.

This site is describing a workflow based on either pre-created terrain in mudbox or max,lightwave...and the use of ETQW console? and I have no Idea actually on what that is? but with that you should be able
to create a heightmap from the mesh.

hereīs the description which I fail to understand when it comes to the ETQW console.
http://wiki.splashdamage.com/index.php/An_Advanced_Terrain_and_Megatexture

Anyone?

Michael

Danner
02-03-2014, 06:57 AM
There is probably something more automatic.. but.. you could use an image of a grayscale gradient, mapped on x or Z, on the color channel, click automatic sizing. Then turn luminosity to 100, diffusse to 0. Now give your terrain a simple UV from Y, and use surface baking camera.

Danner
02-03-2014, 07:13 AM
ETQW is refering to a level editor for "Enemy Territory: Quake Wars" it seems it has a tool to converting meshes to height maps.

MarcusM
02-03-2014, 07:20 AM
You can import terrain object to Unity as obj or fbx, change mesh to terrain (http://wiki.unity3d.com/index.php?title=Object2Terrain) and generate height map (In Unity tab).

Some time ago i try way from WM to LW: http://forums.newtek.com/showthread.php?132364-LightWave-World-Machine&highlight=world+machine

(*.r16 = *.raw)

daforum
02-03-2014, 07:21 AM
Cool link, thanks MarcusM :thumbsup:

prometheus
02-03-2014, 07:46 AM
ETQW is refering to a level editor for "Enemy Territory: Quake Wars" it seems it has a tool to converting meshes to height maps.

yes...I thought it was something like that, Iīm not sure I would like to install a game engine though for this..might be better of with unity.


You can import terrain object to Unity as obj or fbx, change mesh to terrain (http://wiki.unity3d.com/index.php?title=Object2Terrain) and generate height map (In Unity tab).


Some time ago i try way from WM to LW: http://forums.newtek.com/showthread.php?132364-LightWave-World-Machine&highlight=world+machine

Thanks, I had that in mind that unity might be able to work something out, looks messy with the script etc though...have to check it.

And yes..I recall that thread, I have no issues going worldmachine to lightwave, but now I want to try the model exactly as you want in lightwave, or zbrush for laying out main terrain or rock, then use worldmachine for adding erosion flows and see how that goes.

hereīs some fiddling with a divided polyplane, first image-modeled the elevation up, no displacements, then next image I added the rock procedural... but with a distance to y-object gradient so the rock is only appearing on the top, the third image is an erosion flow map found on the net which I mixed in, but with a distance to y-object gradient so it only appears on the low level and not interfering with the rock.
The erosion flow map hasnīt been generated from any of my geometry here, just some image height map I found..so when I get this process working it would look more realistic and cooler.

119848 119849 119850

http://forums.newtek.com/attachment.php?attachmentid=119850&d=1391438676

Michael

MarcusM
02-03-2014, 08:39 AM
My "terrain" have 100m x 100m and 20m height. The rest you will se on image below.

119851

prometheus
02-03-2014, 08:54 AM
My "terrain" have 100m x 100m and 20m height. The rest you will se on image below.

119851

Thanks for the description, will take a look at it, If I can avoid installing other software ..then it might be usuful..if it provides the same results.

one thing that will be lost though, that is sculpted geometry that overides the normals, cliff overhangs etc...that I need to investigate if it somehow could survive a process to worldmachine and back again to lightwave.

Michael

prometheus
02-03-2014, 09:04 AM
MarcusM

did you have any lights set up? and how....it will only turn up black if no lights, since you donīt use any luminosity? only diffuse..didnīt work for me, so I had to use luminosity.

MarcusM
02-03-2014, 09:28 AM
Light have no matter on scene if you want only raw RGB, after render frame you must choose layer with rawRBG to save. I thing this is what you skipped.

prometheus
02-03-2014, 09:36 AM
Light have no matter on scene if you want only raw RGB, after render frame you must choose layer with rawRBG to save. I thing this is what you skipped.

indeed so, but I need to be aware of it for me to skip it, in this case I didnīt know :)
so that works, how about best image format to save out for worldmachine? they mentioned r32 on the http://wiki.splashdamage.com/index.php/An_Advanced_Terrain_and_Megatexture...but not sure exactly
what format works the best, tga32 perhaps?

Michael

Danner
02-03-2014, 09:45 AM
What is confusing about image formats is that sometimes they refer to the total bits and sometimes to the bits per channel. So png32 means 8 bits per channel plus 8 for alpha, but Tiff16 is higher quality because it means 16 bits per channel...

jwiede
02-03-2014, 11:41 AM
The erosion flow map hasnīt been generated from any of my geometry here, just some image height map I found..so when I get this process working it would look more realistic and cooler.
Which explains why it is "pointing the wrong way" in many places -- water should move high->low and sediment spread out from downflow into flatlands, but your water seems afraid of heights instead of having originated there. :devil:

It's not that difficult to do the erosion stuff yourself by hand-placing erosion form images into the displacement texture, you just need to follow some rules to get "plausible erosion". It's achieving "reasonable / accurate erosion" for a given terrain where tools like geoControl & WorldMachine thrive.

prometheus
02-03-2014, 12:29 PM
Which explains why it is "pointing the wrong way" in many places -- water should move high->low and sediment spread out from downflow into flatlands, but your water seems afraid of heights instead of having originated there. :devil:

It's not that difficult to do the erosion stuff yourself by hand-placing erosion form images into the displacement texture, you just need to follow some rules to get "plausible erosion". It's achieving "reasonable / accurate erosion" for a given terrain where tools like geoControl & WorldMachine thrive.

indeed it is so..
yes hand-placing...I figure you mean extract out a height map from the deformed mesh, then handpaint in with photoshop? or do you have another workflow in mind?

and yes, my geologic knowledge of erosions arenīt that advanced, it will also require for me to read up and check reality in order to get the most of it ..as with the rest of the 3d world:)
that erosion image could of course be applied on the whole mesh, in this case I just fiddled around, and added a gradient based on y-distance to the mesh, so it only affects the ground level, that was on purpose
even though it isnīt correct for how a true erosion looks.

I tested to import the height field saved out as 32 tif, in to worldmachine...didnīt look that good, and that is most certainly because of the modeled mesh in lightwave has sharp overhangs so the heightfield gets
that sharp cut off, and that doesnīt look good in a heightfield, that is unfortunatly something Iīm scratching my head about, world machine can not depict any cliffs or overhangs that is displaced over the normals so
to speak.

Michael

probiner
02-03-2014, 12:57 PM
xNormal
basic video here: http://www.youtube.com/watch?v=JIcckNETPOw

Danner
02-03-2014, 05:11 PM
... world machine can not depict any cliffs or overhangs that is displaced over the normals so
to speak.


I think what you want is the so called Vector Displacement Maps. As opposed to a height map (only one axis) and a normal map (displaces on the direction of the normals of the geometry) Vector maps can go in more directions. No idea if world machine can read those.. a little more explanation in this video: http://www.youtube.com/watch?v=fJJQaQDRkG8

Danner
02-03-2014, 05:21 PM
It took me a while to find it, bit this is the first time I heard about this http://www.gdcvault.com/play/1277/HALO-WARS-The-Terrain-of

prometheus
02-04-2014, 03:25 AM
Thankīs Probiner will check up more on xnormal, havenīt looked at it yet but I will ..not sure it will help since worldmachine will probably not allow for creating erosion filters on such a model with vector displacements.

Danner..yes that might be the term for it...great research there, and a lot to follow on the cdcvault, and as you said, worldmachine will probably not be able to handle that, I guess the best thing is to ask on their forums.

Thanks for the research guys, I need some time to investigate it all.

Michael