Shader applied to Object doesn't render correctly after saving/reloading in TG2

Started by PabloMack, October 10, 2013, 05:40:04 PM

Previous topic - Next topic

PabloMack

I have made an object of a plateau that I created and store as an LWO. I was pleasantly surprised to find that I can apply the terrain colors to the object. It looks really nice. However, when I save it and reload the TGD scene, it does not render correctly any more. I have to delete the object, reload it and modify all of the settings to get it to render as it did before. Does anyone know what is going on? I know that Lightwave stores the object's attributes in the object's file. However, the LWO Reader most likely loses something when the program exits. The surface shader association is still there when I reload the scene but it no longer renders properly. Even if I manually reassociate the shader to the object, it has no effect. I have to delete the object again and reload it. This is not good.

Correct Shading: [attach=1]
Problem after reloading: [attach=2]

PabloMack

I converted the LWO file to an OBJ file and then used the OBJ Reader instead. After making the changes, assigning the shader and saving then reloading, the problem now seems to be gone. So I will use the OBJ Reader from now on instead of the LWO Reader.

TheBadger

That seam is also going to be an issue. Its an interesting way of doing things, but efflux posted some stuff in file sharing that would likely be a better solution. That is, if the image you showed is in the same context your final will be.
just a thought.
It has been eaten.

PabloMack

I noticed the seam and I don't know what would make it so noticable.

Dune

Why not transform this object to a Vector Displacement map? You can work all procedural after that.

I never got the LWO reader to work properly, and I usually transform all OBJ's to TGO's also.

PabloMack

I just found something called Terrescuptor. A guy in a forum says that this program will generate a height field from a mesh OBJ. Does anyone have any experience with this program?

Forum: http://www.crydev.net/viewtopic.php?f=315&t=114677
Website: http://www.lilchips.com/hmesalpha.htm
Download: http://www.lilchips.com/hmes/HMES-2013-06-08.zip

Dune


j meyer

And since a heightfield is basically a depth grab of the object
you should be able to do that with LW anyway.

PabloMack

Quote from: Dune on October 11, 2013, 01:36:03 PM
No, but in the same forum it says; linux only....

The exe is a Windows app. I downloaded and ran it but it has its limitations. After several failed attempts (dimensions too large etc.) I got it to generate a heightmap. It does have an export to ter file but it did a poor job of importing in the first place. The user interface is very attractive and professional looking, though. I'll hang on to it because the newbie in the forum praised it highly.

Quote from: j meyer on October 11, 2013, 01:54:03 PM
And since a heightfield is basically a depth grab of the object you should be able to do that with LW anyway.

I'll look into that, thanks.

yossam

It looks like it might be good for getting a general shape. I imported the supplied .ter file and applied some settings not bad really. More to explore.................. :)

PabloMack

Quote from: j meyer on October 11, 2013, 01:54:03 PMAnd since a heightfield is basically a depth grab of the object you should be able to do that with LW anyway.

I figured out a way to generate a heightfield image in Lightwave. LW supports two SGI formats with 48 and 64 bits of precision. I presume these are 16-bits per channel where 48-bits is RGB and 64-bits is RGBA. I just tried the SGI 48-bit format which produces a RGB file. TG2 did import it and it seems to be working.

I found that I can explicitly set the dimensions (in meters) of the image grid (i.e. how many meters appart the pixels in the heightfield image represent) near the bottom of the Heightfield Load panel. But at the very bottom of that panel is says "Height range: min = 0 mm, max = 229 m, range = 229 m". Where did it grab the number "229" from? It must be an educated guess given the horizontal dimensions. To get the 315m that I want, I just set the Height Multiplier in the Displacement Tab of the Heightfield shader to the ratio 315/229. Is this what everyone else does?

Dune

If I use heightfields, I usually add a 'heightfield adjust vertical' to set the range.

So you imported a object in Lightwave and exported(?) that to an SGI? Must try that....

PabloMack

Quote from: Dune on October 13, 2013, 01:17:23 PMSo you imported a object in Lightwave and exported(?) that to an SGI? Must try that....

What I did was to load the object into Layout. Then create an orthographic camera to look down on the object. Disable all lights and set the surface to 100% luminance. In the Node Editor I created a gradient node. Put the existing key at the low end and set to zero and assign it full black. Create a second key and set it to the highest point on your object and assign it full white. Select the Y Coordinate as the input. Set the camera size to fit your object and the resolution so that each pixel equals one meter (unless you plan to scale it to some other size later in TG). Select VPR and you will see the image. Render then save RGB as SGI 48-bits. If you want Alpha then save to SGI 64-bits (I presume). In order to use the heightfield instead of an object, I had to edit the object so the edges converge to the ground plane.

Here is my result in TG2: [attach=1]