Hi all!
I'd appreciate some help! I am sorry if this has been discussed to death already, but after a number of searches, I didn't come up with much. I am beginning to learn Terragen 2 again after years of not using it. And I am about to tear my hair out over this problem. If I try to use something like a power fractal to displace the surface of a rock object or an imported mesh, the mesh splits apart, opening gaps between all the edges. It doesn't matter how low or high poly the mesh is. Here is an example:
[attachimg=1]
This is just a simple OBJ cube with a power fractal plugged into the surface shader slot. Another example:
[attachimg=2]
This is just a cube with subdivided smooth several times in Blender and exported as OBJ.
What am I doing wrong? Or is this just the way it is, with no solution? I notice that if I use Terragen 2's native sphere object, it works as you might expect it to. But I'd like to do some ZBrush sculpting of some rocks to use close to the camera and then add some fine procedural detail with Terragen 2 in my render. I want more control than a purely procedural rock would allow, at least for some prominent objects.
Thanks!
Here is another example, this time with an OBJ directly exported from ZBrush:
[attachimg=1]
Unfortunately displacement on imported objects is not recommended at this time. It works to a certain degree and with minor displacement, but the kind of thing you're trying to do is generally not going to work very well in Terragen currently. On the bright side TG does handle very high poly objects fairly well, so if you can just bake it to real geometry it might work that way without displacement.
- Oshyan
Quote from: Oshyan on January 05, 2015, 12:46:26 AM
Unfortunately displacement on imported objects is not recommended at this time. It works to a certain degree and with minor displacement, but the kind of thing you're trying to do is generally not going to work very well in Terragen currently. On the bright side TG does handle very high poly objects fairly well, so if you can just bake it to real geometry it might work that way without displacement.
- Oshyan
I always cry reading this. Haha. I'm no good at modeling (terrible in fact), but fairly decent at PFs and displacements in TG.
It isn't quite made for this kind of work for objects as Oshyan said but actually with a little care
you can get very usable objects out of Terragen if you use the "Ray trace objects" option unchecked in the render tab.
Not sure what your problem is here.
The object i used here was high poly but you can use low poly objects too to some degree.
It was a ball object when i imported it in Terragen. Then i exported it with the micro exporter as an obj file.
But you have to texture it for yourself if you want to use it outside of Terragen. The micro exporter doesn't export textures.
I played a little more with some settings and objects.
If you want better displacement make especially the edges of the object rounder with more polygons.
This is especially true with fractal displacements as they are displacing in every direction.
You could get away with less polygons on the object with image map displacement that are only to one side etc. for example.
Objects with surfaces that have very abrupt changes in direction like in a cube are hard to work on with this method.
The normals on the objects are important too.
Below is the same kinda high poly cube with one flat smoothing in Poseray and the other one with very smooth option.
As you see the smoothed object is better displaced (kare_smooth.jpg)
If you want a rock with many surfaces and it is a kinda round rock it should work without much problem if you smooth it especially before importing into Terragen.
The rock object you tried above needs probably more smoothing before importing into Terragen.
You can even displace a very basic 4 polygon surface to a landscape or whatever you want.
But there is a line when you have to use a dedicated 3D software for such things when you use more complex objects.
The other issue if you're going to attempt it with Raytraced Objects disabled (again, not recommended) is to avoid larger-scale displacements. The original examples above appear to be potentially using some larger-scale displacements which will almost certainly cause discontinuities.
- Oshyan
Thanks for the info. It would be very nice if it worked like the micropoly displacement you see in programs like Modo or Lightwave. Some kind of micropoly vector displacement would be even better!
Honestly though, I am surprised that something like this hasn't been implemented in Terragen, since so much of it seems to be about displacement. My interest in this regard isn't just rocks or logs or other loose objects. What if I sculpt a nice piece of topography or a mountain or cliffside or something in ZBrush and then want to use it in Terragen with additional displacements for fine detail? Even with a very high-poly model, when it is something like a mountain massif, you wouldn't want to get anywhere near the surface or you'd see the geometry breaking apart. You could always sculpt something like that and convert to an image to use as a height field. But you couldn't have overhangs in the original geometry this way.
It seems like there is something quite wrong with the way Terragen displaces the mesh. Of course, I am not a software developer, and I don't know how Terragen really works. There is probably a good reason it is the way it is. And maybe what I am wishing it would do is impossible for some reason I don't understand. But I don't see why the geometry couldn't just be dynamically tessellated or something according to how close the camera is and what resolution the render has. It wouldn't matter if the mesh gets triangulated in the process as with Sculptris or Blender's dynamic topology. Isn't something like this used with Renderman displacement shaders? Isn't this sort of what Terragen does with terrains anyway?
Oh well. For now, I'll just use bumpmapping on imported objects.
You can sculpt in external apps and export as VDisp and *apply it to terrain*. There are several recent discussions about how to do this with vdisp sources from various apps including Zbrush and Mudbox.
Applying any kind of displacement to the terrain (or any *built-in* displaceable object) works very well. The problem is that arbitrary imported objects are treated differently by the render engine and displacement is not currently handled properly on those types of objects. It's a fundamental render engine limitation at this point, simple as that. It's certainly something we want to address, but it does require some pretty fundamental changes to the render engine to work properly, which is why it hasn't been implemented yet. We'll get there...
- Oshyan
Remember there's only 1.5 guy working on TG! I am still amazed about what TG can do.
Thanks for the advice and explanation.
1.5 guys? Wow! And yes, it is amazing what Terragen can do!
^^ So I guess Oshyan is the half. ;D Probably not the best way to put it, but its funny :D Well, could be a complement... Oshyan does a lot for only half a person :P
Sorry, just sounds funny :-X
I think someone just had his license cancelled... ;D
Although I always thought Oshyan was the full-timer and Matt the part.
Kadri,
A special thanks for your help! I've been trying a few things and see what you are saying. If the surface has a large radius of curvature relative to the polygon size, the gaps aren't visible. So I suppose that one can either reduce the sharpness of the curvature or increase polygons. And it seems to help a great deal to make sure to limit the amplitude of displacement relative to polygon size. It seems that if I am sculpting a rock and all I want for the added displacement in Terragen is detail finer than the detail already in the model at the polygon level, it shouldn't really be too much of a problem, except perhaps at sharp corners and the like.
Quote from: oysteroid on January 06, 2015, 07:09:29 PM
Kadri,
A special thanks for your help! I've been trying a few things and see what you are saying. If the surface has a large radius of curvature relative to the polygon size, the gaps aren't visible. So I suppose that one can either reduce the sharpness of the curvature or increase polygons. And it seems to help a great deal to make sure to limit the amplitude of displacement relative to polygon size. It seems that if I am sculpting a rock and all I want for the added displacement in Terragen is detail finer than the detail already in the model at the polygon level, it shouldn't really be too much of a problem, except perhaps at sharp corners and the like.
Yes if you plan accordingly and know the limits you can use it very easily for more things then you think.
I use it sometimes when i don't want to model parts for objects.
It is very easy to add detail with image maps in this way for example.
This was a test from another thread here around with the same subject.
A repeating basic image on an imported ball object:
[attachimg=1]
Actually as Oshyan said if you use Vectoral displacements you might get more-better-different results too maybe.
That is one part i haven't tried in Terragen.
Users like Ulco (Dune) and others used it for getting holes into terrains if i remember right.
This is the monster thread (18 pages) i think:
http://www.planetside.co.uk/forums/index.php/topic,16110.0.html
Another one:
http://www.planetside.co.uk/forums/index.php/topic,16154.0.html
Just remember, Vector Displacement only works that well on terrain. But if you have a high enough poly object and you render it without raytracing, you can indeed get pretty good displaced results on imported objects.
- Oshyan
And don't forget the normals of the object.
I use Lightwave but when i export my obj files (Poseray can import LWO files too) i use Poseray before i import them into Terragen.
Depends on which software you use, you might not need it maybe, but in general Poseray obj export is very friendly for Terragen use.
The "Recalculate normals" option (with sometimes 180 Crease angle) in the "Groups" tab in Poseray is sometimes more of a help then using more polygons on objects as i wrote above.
Just to be clear, in the smoothed example of the cube above that was what i meant what i did in Poseray.
2 things: Oshyan, I didn't mean anything belittling by mentioning 1.5 guys ;)
And when you work in LW and want to send stuff to Poseray, put differently angled things (to put it that way) in layers; in Poseray it's then easier to recalculate softer or harder parts differently by obscuring certain layers temporarily.
Smooth Normals are critical, as I discovered last night. In fact it's OK to use a lower poly object as long as you have properly calculated Smooth Normals and you render with Raytrace Objects disabled. In that case you can actually get pretty good displacement on imported objects.
No worries Ulco. If we're talking about direct contributions *to the software*, then it's a lot less than 0.5 for me (virtually nothing, really), and a small bump for Jo's continued involvement (he helped with 3.2 for example).
- Oshyan
Quote from: Oshyan on January 07, 2015, 04:16:57 PM
Smooth Normals are critical, as I discovered last night. In fact it's OK to use a lower poly object as long as you have properly calculated Smooth Normals and you render with Raytrace Objects disabled. In that case you can actually get pretty good displacement on imported objects.
...
Yep.Whatever magic Matt uses i don't know, but it looks like when the objects are smoothed Terragen does see those parts kinda more subdivided or whatever.
Thanks, guys! I finally got around to trying using Poseray to smooth the normals and it really seems to help dramatically!
I also fiddled for a while and got the vector displacement thing working with maps exported from ZBrush. So thanks for that suggestion! You guys are very helpful!
I use Blender for most 3D work. So I wondered if I could smooth the normals similarly there. Of course, there is the option in Blender to use smooth shading. But when I checked the exported OBJ, it wasn't smooth. But then I found an option in the OBJ exporter to "write normals". If the object is set to use smooth shading and "write normals" box is checked on export, it works just the same as what I got out of PoseRay, just in case anyone else out there is a Blender user.
I notice a lot of people around here seem to like PoseRay. What else do you use it for?
Poseray; I always take my LWO's through Poseray to make them into OBJ's. And I use it to combine shared maps/parts from DAZ objects, so they're not ten the same maps to be called ten times in TG.
Quote from: Dune on January 08, 2015, 02:54:35 AM
Poseray; I always take my LWO's through Poseray to make them into OBJ's. And I use it to combine shared maps/parts from DAZ objects, so they're not ten the same maps to be called ten times in TG.
I use it in much the same manner. Also for creating the Parts shaders many .obj's I dl that have a Materials Tab fully populated but Groups with multiple textures on the same part which TG doesn't grok.
Quote from: Kadri on January 07, 2015, 04:29:56 PM
Quote from: Oshyan on January 07, 2015, 04:16:57 PM
Smooth Normals are critical, as I discovered last night. In fact it's OK to use a lower poly object as long as you have properly calculated Smooth Normals and you render with Raytrace Objects disabled. In that case you can actually get pretty good displacement on imported objects.
...
Yep.Whatever magic Matt uses i don't know, but it looks like when the objects are smoothed Terragen does see those parts kinda more subdivided or whatever.
If the object doesn't have normals, Terragen defaults to using the face normals. These are usually discontinuous from face to face. If two neighbouring faces are displaced along a different normal then the object splits apart at the shared edge (Terragen doesn't fill in the gaps).
If the object has normals (vertex normals) and the normals are the same for each shared vertex (they are "smooth"), the normals at the face edges will be the same for all neighbouring faces, so displacement doesn't cause them the split separate.
Matt
To summarise:
Displacement works on imported objects. The renderer needs to have "ray trace objects" turned OFF. To avoid splitting edges, the object needs to have normals, the normals need to be smooth across the whole surface, and "use smooth normals" needs to be enabled on the object reader (which it is by default).
However, shadows (and self shadows) of these objects will not be displaced. Nor will reflections and GI contributions. That's because ray tracer can't displace imported objects, it can only displace built-in displaceable primitives such as the planet, plane etc. This limitation means that the lighting on the object might look strange if displacement is extreme, as the shadow it casts on itself is cast by the non-displaced surface.
We plan to make the ray tracer able to displace all objects in a future version. This will solve the shadow and reflection problem and will allow displacement while "ray trace object" is on.
Matt
Also, there is a separate feature in TG3 Professional called "mesh displacement". This feature does work with ray tracing because it displaces the vertices of the object at the time of import, before any rendering begins. If you want to use Terragen procedurals to displace an object and have correct shadows and reflections, you can do this with the "mesh displacer" input on the object. The detail of the displacement depends on the detail of the imported object, because this is not micropolygon displacement.
Matt
Thanks for the explanation Matt. I wanted to test why the Mesh displacer didn't displace in the same way. It is clear now.
Just one question. Probably not so urgent but is there any plan to use more optimized (polycount) obj output from Terragen?