Id love to see the code you used to do this
JamesG: Ah, C++. I haven’t touched the stuff since college. It’s looking more and more like I’m gonna have to bite the bullet and kick the rust of those skills. Assuming any have survived. My memory is spotty at the best of times. But yeah, it seems like if I want to get serious with this stuff, I’m gonna have to… Well… Get serious. Any advice for a very very very old timer in starting out with UE4 and C++?
Messen: 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
[=J. J. Franzen;336646]
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).
My first generation. Truncated octahedron (24 verticies, 44 faces). I use planar XY coordinates. Now I am going to calculate spherical UVs
Spherical UV:
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
void UpdateLocalBounds();
void CreateProcMeshBodySetup();
void UpdateCollision();
Also, A FProcMeshSection* GetMeshSection(int32 MySection); To retrieve a pointer to the sections would be nice, but not necessary with the above.
Hello fellow ProcJunkies!
I just got SiggiG’s procedural cylinder going in 4.8
What I don’t know how to do is activate collision on it… any tips?
[= Studios;340871]
Hello fellow ProcJunkies!
I just got SiggiG’s procedural cylinder going in 4.8
What I don’t know how to do is activate collision on it… any tips?
[/]
to enable collision :
mesh->CreateMeshSection(0, Vertices, Triangles, Normals, UVs, VertexColors, Tangents,**true**);
Aww Yiss!
One word fixes. Gotta love em
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:
and got the following result:
For my vertices I specified (apart from FVector positions) only UV coordinates.
Not to highjack the thread but are we able to do LSystems and metaballs in unreal? I saw the metaballs in practice.
[=i73;341370]
Not to highjack the thread but are we able to do LSystems and metaballs in unreal? I saw the metaballs in practice.
[/]
Yup that is entirely possible. One of the tech designers at Epic even showed off a working LSystem implementation in one of their live shows (seeforums.unrealengine.com/showthread.php?48406-Missing-L-System-docs ).
I’ve seen a metaball implementation floating out somewhere, don’t have the link right now though.
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.
So after 2 weeks of coding I made first prototype. Check this out!
https://www…com/watch?v=PLzu-nCjhA8
Nice. Since we’re sharing. I’ve been working on basic procedural/destructible terrain for the last 6 months or so.
If anyone else is doing the same and would like to collaborate please PM me. I’m aware of cubiquity, but am looking to go beyond that if possible.
Currently working on integrating the new InstancedStaticMesh support with the ProcMesh.