Meessen: Wow man. That’s outstanding. Very well done. Have you had any time to play with dynamic subdivision/tesselation to smooth things out as they get closer, then ditching that detail as they get farther away? And how are you handling UV creation? Just basing it on the world space? I’m very new to all this (read that as I’m teaching myself as I go, and not very well obviously) so I’m always on the lookout for how other people are accomplishing things.
Cheers,
J^2
[/]
Haven’t worked with dynamic subdivision/tessellation yet, might be something to look into. It is possible to increase the resolution of the terrain via the settings, but this would of course effect the entire loaded terrain, which isn’t optimal for performance. The tri-planar texturing is indeed based on the world position. I still need to try the multi-smooth blending material idea which I mentioned earlier in the thread. I am also learning as I go
This is really amazing stuff. In the past (4.7 version) I used ProceduralMesh and SetProceduralMeshTriangles function. In new version 4.8.2 it doesn’t work. I don’t worry much because I like new API and I am going to use it instead.
I started from simple blueprint. It’s even easier to use than previous solution. I hope performance will be also better. THX
Here is my first mesh - rectangle from 3 squares, 8 verticies. I use 3 types of materials (brick, color, bush).
Trying to create a child class of the ProceduralMeshComponent in order to customize some of the functions for my needs. But, many of the critical elements (functions and variables) are “private” in the cpp instead of “protected” like TArray<FProcMeshSection> ProcMeshSections; can you please change this? Also, if you could make the following functions virtual?.. Please
Hey, guys, do you know what those “stains” could be. I implemented wireframe-like material for my procedural mesh component. The material is very simple:
Just wanted to thank people for their posts and insight.
And also ask if anyone have had any problems with huge memory overhead when creating Procedural mesh components( 40 times of my estimated raw data 13mb raw taking 800 mb as mesh) as well as problems removing sections(simply won’t go away)?
I’m not sure this accounts for all the data usage but there are 3 copies of your mesh data, the One you send to the CreateMeshSection Function, the FMeshProxySection and the Actual Factories. Then CollisionData is it’s own separate memory allocation. Tangents, normals, color data, If you’re not taking those into account could be factoring into it as well. How are you removing the sections with the ClearMeshSection function?
[=Xilverback;342115]
I’m not sure this accounts for all the data usage but there are 3 copies of your mesh data, the One you send to the CreateMeshSection Function, the FMeshProxySection and the Actual Factories. Then CollisionData is it’s own separate memory allocation. Tangents, normals, color data, If you’re not taking those into account could be factoring into it as well. How are you removing the sections with the ClearMeshSection function?
[/]
Yeah I did a recalc of the size and if there are three copies being stored it would explain the memory usage.
Clearing and creating sections are done by (int)VoxelTypeEnum::Air and used as id for the clearSection, same with creating sections.
I have one Array for vertex and triangles per (int)VoxelTypeEnum 3 of them. Air, Dirt, Rock.
What I think is that i need to dig deeper, look at how the procedural mesh is put together and actually put this together at the same low level, accessing the actuall base level vertexbuffer etc.
For now I rescaled and recreated all my “voxels” as actors, it works for the concept and gives me “onClick” functionality, but needs to be fixed if the concept seems to be fun. But don’t want to burn time getting things just to render in the way it should look and behave as it should, when I can do it in a smaller scale for now.
CreateMeshSection works very well for me. I tried today to use Kismet **CalculateTangentsForMesh ** but it took so long to compute all data. So if You care about high performance You probably should calculate normals and tangents on Your own.
This thread has been super helpful so I was wondering if someone could help me out with this. I’m using the new ProceduralMesh component to implement dual contouring. It looks like my mesh creation is ok but the lighting/texturing is messed up. I’m planning to do the texturing with a shader so I’m not sure if UVs matter but I calculated UVs for the mesh anyways. I also calculated tangents but I’m not 100% sure that they are correct. I was mainly wondering if the blackness is a result of UVs, tangents, or normals.
[=lspangler;361818]
This thread has been super helpful so I was wondering if someone could help me out with this. I’m using the new ProceduralMesh component to implement dual contouring. It looks like my mesh creation is ok but the lighting/texturing is messed up. I’m planning to do the texturing with a shader so I’m not sure if UVs matter but I calculated UVs for the mesh anyways. I also calculated tangents but I’m not 100% sure that they are correct. I was mainly wondering if the blackness is a result of UVs, tangents, or normals.
[/]
I had a similar problem (although not this well demonstrated :D). My issue was the normals. I’m using worldspace triplanar textures UVs for my textures, I’d recommend that for static landscape. For my normals, I would up calculating them by averaging the crossproduct of the triangle edges. As long as your verts are welded you should get a nice smooth contour, If your want hard breaks through you’ll have to break those verts and do that separately.
EDIT: Yep I’ve fixed my problem. I don’t think it’s really that relevant to anyone else so I won’t put the solution here (basically just me being dumb)
Anyways, I basically have dual contouring implemented:
So if anyone has any questions about that I might be able to help.
I still have to figure out how multiple materials, multiple chunks, and texturing is going to work so I have quite a bit of work before the basic terrain is there.