applying power fractals to imported .obj terrain files

Started by gregtee, September 17, 2013, 02:10:44 PM

Previous topic - Next topic

gregtee

Hello all,

I was wondering if there's a way to attach power fractals to imported geo from Maya that's been exported as .obj.  I did a quick search of the forum and found some threads that indicated it could be done but nothing seemed to say exactly how to do it. 

I've got a terrain of a mountain that was modeled in Maya as it has a very specific shape.  The problem is rendering it in Maya with all the detail that TG handles easily so I thought I'd import the obj file and start applying surface shaders to it.  That's where the problem starts.  I can get color information on it with no problem but I can't get it to displace, or even smooth properly.  The geo remains faceted and undisplaced no matter what I do. 

I've attached the power fractal shader to the input field of the Surface Shader of the obj import object.  I've tried messing around with the scaling and displacement amounts to no avail.  Is there something I'm missing?  It seems from reading some past threads that this is possible but it's eluding me at the moment.

Thanks

Greg

Supervisor, Computer Graphics
D I G I T A L  D O M A I N

Oshyan

Displacement on imported objects is not possible unless Raytrace Objects is *disabled*. You then lose the advantages of raytraced objects, of course (faster, higher quality, in general).

If you can find a way to export your terrain as a vector displacement map, you can apply it directly to the Terragen planet as displacement, and then do subsequent displacement on it. That would likely produce the highest quality results.

- Oshyan

j meyer

Quote from: gregtee on September 17, 2013, 02:10:44 PM
.....

I've attached the power fractal shader to the input field of the Surface Shader of the obj import object.  I've tried messing around with the scaling and displacement amounts to no avail.  Is there something I'm missing?  It seems from reading some past threads that this is possible but it's eluding me at the moment.
.....
As an addition to Oshyans remarks:
Try the displacement input or the child layer input of the surface layer instead.With ray tracing
enabled you should at least get a sort of "bump-ment".
The faceted look might be due to no exported normals or some sort of creasing,a look at
mayas export settings should clarify this.If not it's maybe just a corrupted obj file.
Just some thoughts.


cyphyr

I have found that if the imported object has been UV mapped power fractals will not apply to it properly. If you can COMPLETELY remove any UV mapping this may help.

Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
Ryzen 9 5950X @3.4Ghz, 16Gb (TG4 benchmark 4:28)

gregtee

Thanks guys.   

I was wondering if there's a way to take the obj export from Maya and somehow in TG generate a heightfield from it.  I could then disregard the obj and just work on the heightfield as I would any other TG asset.

Thanks again

Greg

Supervisor, Computer Graphics
D I G I T A L  D O M A I N

Oshyan

There's no way to do that currently, but there are functions in some other apps, maybe even Maya itself, that might be able to output a heightfield-like result that you could use for displacement in TG. I'm not familiar enough with Maya to know if this is possible, much less how, but I recall people doing similar things in either Maya or 3DS Max.

- Oshyan

FlynnAD

Quote from: gregtee on September 18, 2013, 09:15:15 PM
I was wondering if there's a way to take the obj export from Maya and somehow in TG generate a heightfield from it.  I could then disregard the obj and just work on the heightfield as I would any other TG asset.

Yeah, this is certainly possible. In Maya (I used Max to do this), make an orthographic camera looking straight down. Render a square image (such as 1,000 pxls x 1000 pxls), with either the Zdepth properly synched, or else use a black-white gradient map on your mountain mapped to the vertical direction. Then you've got a grayscale height map. Save it in EXR!! You need the 32-bit depth to get a good terrain.

Then in TG3, use the imagemap as a heightfield generator. No need to import the OBJ at all.

The quality of your final TG3 mountain depends on
1) the smoothness of the geometry in Maya (with a large exr image map, you will actually see the individual facets of the OBJ if the OBJ is not decimated enough;
2) the size of the rendered image (bigger is better, with obvious limits as the exr becomes absurdly large;
3) the size of the patch in the Compute Terrain node.

Matt

Dune

Will the facets converted into gray scale not be smoothly interpolated in TG? I think they will, so you might get away with less quality and add tiny fractals in TG again.

digitalguru

#8
gregtee

do you have access to Mudbox?

FlynnAD

Quote from: Dune on September 19, 2013, 03:32:08 AM
Will the facets converted into gray scale not be smoothly interpolated in TG? I think they will, so you might get away with less quality and add tiny fractals in TG again.

The reason I noted to use 32 bit for the grayscale map is that 8 and 16 bit will leave you with a stepped gradient, like abstract terrain on architectural physical site models. The 32 bit grayscale is so precise that it will grab all the heights of the OBJ triangulation. So to answer Dune, you will see all the facets. It might not be a big issue if you go and apply heavy displacement to the ground afterwards in TG3; then you can use a low poly OBJ. But if you want the "accurate" model that you had in the OBJ/ Maya, with only minor granulation as displacement in TG3, it's better to use a high res poly, as a low-poly OBJ grayscale map will telegraph the facets.

Just my two cents from what I've ran into myself.

Matt

Dune

Thanks FlynnAD. I was just curious if it worked that way, as I am now working with an 'integer TIF', and found that a very contrasting (almost pure) black and white image gave smooth heights. But then again, I don't really know (at all) what an 'integer tiff' is. Strangely, the black are heights and the white are lows.

digitalguru

#11
integer tiff can only represent values between 0 - 1

float tiff can represent any floating point value and can store values over 1

in displacement maps and HDR this better represents the smoothness of a gradient or extreme displacement values

Dune

Thanks. I wonder why the GIS guys then gave me that file to make a heightfield if it's better to have floating tiff.... and it also eludes me why the black are higher than the whites. I don't suppose there's some hidden information in the file that you don't see when opening in PS? I would like to change some areas in it, so I'll give it another good look. Sorry for hijacking the thread, by the way.