#Custom GPU Based Clipmapping for terrain
1 messages · Page 1 of 1 (latest)
damn I been researching old click maps to try get this affect . any chance you can show us how you did this
I made it in c++ as a custom actor class
i can share the code if you want but its kinda ugly and not commented at all lol
this is what i followed to make it
Chapter 2. Terrain Rendering Using GPU-Based Geometry Clipmaps Arul Asirvatham Microsoft Research Hugues Hoppe Microsoft Research The geometry clipmap introduced in Losasso and Hoppe 2004 is a new level-of-detail structure for rendering terrains. It caches terrain geometry in a set of nested regular grids, which are incrementally shifted as the ...
TerrainClipmap.cpp
TerrainClipmap.h
|That is perfect thank you Im going to try do something amazing with it ... As soon as Ive done it Ill share as well .
Thank you !
cool! there are some things missing, that can probably just be commented out
Yea I got it to compile and put the blueprint in .
holes
and collision was commented out .. not too sure what those two classes do but Ill work through your code in the next couple of days ,
By the way how long did this code take you ?
all the JetCollisionGenerator class does it use blueprints and the dynamic mesh functions to simplify the mesh, can work completely without it
this took me a few good weeks to get working right with no seams or cracks
though i didnt write it from scratch, i ported it from my godot version
and that took me alike a month lol
Well I like the structure of it and your implementation of to work in blueprints . well structured code and any advancements i make Ill be sure to share
yeah i thought overriding the OnConstruct function to run editor only code was pretty clever lol
Three things I want to do
1 Bend the mesh to s Sphere
2 Mip maps based on distance
3 Hight map Tessalation and Granularity distance basesd
4 Spawnables on a sphere
5 coordinate system for the sphere with pre generated buildings landsmarks
probable take me like 6 months lol
i heard an easy way to "fake" planets with a clipmap is to add curvature based on your z position
though thats not a true planet type system
well the other way is to itterate through all the vertaces and set the equal the distance from the origen of the sphere
Next you could apply the heightmap ...
The coordinate system runs separately to this and so does the buildings using
the next things is to place a hex grid system like tiles on the sphere
using Goldberg Polyhedra
ah yeah a cubed sphere or something right
before this clipmap thing i wanted to make a quad tree system that used a cubed sphere for planets
but that was a bit out of my skill range lol
The clip map is just for terrian from distance and vertex of the origional mesh .
this other stuff is for user to click on and build things ...
I saw the tutorials on bending a mesh into quads ... that would not work for this .
what you got here is fine .
the purpose is for Terrain generation and mips . and can be adjusted to a sphere especially if the texture and height map is wrapped . ... The grid system should still work based on closest vert
distance fileds etc .
still wrapping my head around it ..
So the first sample I worked with was Nvada clip map sample and got the code for that in c++ and Direct X but it no longer compiles since the direct X API. They use it simply for planetary texture not original function of moving verticies around and terrain generation
you find a clip map under one of the samples
ohhh yea i see what you mean
this might be too messy to help, but heres my material blueprint i made to actually displace the vertices
oof all the parameter names got wiped
I actually got the whole things working without displacement (implement it later ) but it gives me a great starting point as the grid system works as intended
thanks once again for that code .Its invaluable
awesome! im glad to know my code is readable lol
oh.. you might not notice until you actually start displacing the vertices, but the seam mesh is backwards
but if you set the static mesh component to reverse it will be good
Ill definitely have to try invert the normal .
good stiching job anyway
A quick question does the displacement happen on that generated grid or separate underlying mesh
so what I'm trying to work out is do I need a mesh underneath it to displace or does the displacement happen directly on the clipMapGrids itself
ie if I have the sphere would the displacement happen on the verticies of the sphere
yeah the displacement happens directly on the clipmap tiles/grid vertices
you might have to do something like pass the center position of the sphere to the material/shader and when doing the displacement, minus the vertex pos with the center pos, normalize it and scale it with a heightmap
i have no idea how collision would work though lol