Holes in displacements

Started by jrocket, November 05, 2015, 09:57:41 PM

Previous topic - Next topic

jrocket

Hi again! I seem to be getting some gaps in my displacements. I have seen this problem with other maps made in hammer, but from looking around at forum posts it seems that the fix in hammer is to move the verts around to snap them. In 3ds max, my verts all look fine.

I used polygons-to-displacements to generate the displacements. I even tried making sure that the vertex locations are nice whole numbers before using the polygons-to-displacement tool, but the problem persists. Do you have any tips for removing gaps? I'm not too far along that I couldn't re-make my displacements if needed.

wallworm

In cases where I have seen that, the solution was to click the Precise Coords checkbox in the VMF exporter.

If that doesn't solve it, click File > Save As... Archive and send me the zip. I'll look into it when I have some time.

jrocket

Still happens with precise coords off or on.  :-[ Wall Worm Pro seems to have the same output. Anyways, here is the zip file. It was too big to attach with textures, so I just included my mesh before displacement-ing it, and a skybox/light.

wallworm

After opening the scene, I have a few suggestions.

1) The terrain's pivot has been moved. You may find that creating displacements from the terrain works best if the XForm is reset before creating the displacements. I do not know if this is the cause of the error.

2) Many of the Quads in the terrain are not planar. The displacement generation functions will probably produce the best results if the quads are planar.




I do not know if these are the root causes. But I'd suggest first resetting the root object xform and then generating the displacements.

If that doesn't solve it, I'd rebuild the base terrain with these tips:

1) When setting up the template terrain, keep all the base polygons planar. This means that you should keep it very simplistic. You can still include basic tunnels, etc. But only build the terrain with functions that keep everything planar (like Extrude functions). (You may also find that you get better results if you also use the SnapVertToGrid modifier from WW store on the base mesh.)

2) Create your displacements from the simple mesh. Do not edit the displacements, however. Instead convert them all to a single Sculpt Mesh.

3) Do all terrain sculpting on the sculpt mesh. So in this case, you'd convery your sculpt mesh into the terrain that you already made. You can use things like conform, etc, to actually conform the sculpt mesh to a mesh you already made. Remember to hit Commit in the modify tab when you want to update the underlying displacements.

Hopefully this helps some.

jrocket

Thanks for looking into it. I'm pretty sure that I moved the pivot to the origin at one point, so I don't think that's the issue.

Is there any way to make all of my quads in my mesh planar, even if it moves stuff around?  I don't really care so much about what the underlying brush shape looks like- it's only the displacment verts that will be seen and should have no such planar restrictions.

This wasn't in the file that I sent you, but I am looking into importing terrain data from World Machine(with a custom HLSL shader to render it properly). So, starting with all planar parts and sculpting them isn't really feasible.

wallworm

I don't know of any plugin or script off hand that forces all polygons to be planar. I once thought about building a modifier for it, but I got distracted with other things that seemed easier :)

As for bringing in data from other sources, you can still work this way with the methods I explained. But I'd need more details on the data format you are bringing in from World Machine. Is it a mesh? Is it a heightmap? A normalmap?

jrocket

It would be either a mesh or a heightmap that I would bring in to max to generate the mesh from with the displace modifier. Then I would convert each poly of that mesh to Source displacements with the "poly to displacement" tool.

I suppose it's possible to simply make a flat plane with a good number of divisions, convert to displacements, and then match my sculpt mesh to my high poly terrain. I'm not sure how that would play into the visibility system in-game though. I'll give it a try.

wallworm

That should generally work.

My hint is this: If you have a heightmap, simply add a Displace Modifier to your Sculpt Mesh and apply the heightmap as the bitmap in your Displace Modifier. This is a procedure I've been meaning to document in an educational video for a long time but haven't gotten around to it. (You can use any modifier on a sculpt mesh that doesn't change the vertex #/order (topology)).

jrocket

What about modifying uv's in the sculpt mesh? I tried applying a uv xform to tile my uv's but that doesn't seem to get propagated back when I commit my changes. I'd also like to relax my uv's to even out the vertical distortion caused by the displace modifier.

wallworm

Caught me just preparing to call it a night :)

The UVs cannot be changed on the sculpt mesh. This is because the only thing currently stored in the sculpt mesh is it's relationship to the original displacement vertices. You can only change UVs on the underlying displacements. If necessary, commit your sculpt mesh and revert to displacements. Then select them all and apply the UVW XForm on them. Then rebuild the sculpt mesh.

Relaxing the UVs is not possible. Unless there is something new added into Hammer, it shouldn't be possible to relax the UVs in Hammer either. The UV on each vertex of a displacement is interpolated from the underlying faces. The planar mapping of the underlying brush side is mapped to the displacement. This precludes relaxing the UVs. So even if I add UV support to the sculpt mesh, it will only be able to do planar mapping offsets, scales and rotations. No relaxing. That's just the technical design of displacements in Source.

There is a parameter you can add to the WorldVertexTransition Shader called $seamless_scale to alleviate some stretching.

SMF spam blocked by CleanTalk