Skip to main content
Share Your Experience: Take the 2024 Developer Survey
7 votes
Accepted

Unity block chunk generation pattern

Remember, the whole point of using a chunk mesh is to try to render just the outside skin, and hide all the internal detail inside the chunk where we can't see it. If we generate a whole cube (all 12 ...
DMGregory's user avatar
  • 135k
6 votes
Accepted

How can I reduce the sharpness of my generated terrain?

Issue: The scale of the terrain in the sample image seems to be much larger. A hill is represented by at least 10x10 vertices while your mountain is represented by at most 5x5 vertices. Solution 1: ...
DarkDestry's user avatar
  • 1,441
6 votes
Accepted

Does anyone know what terrain generation algorithm is used here?

In addition to what Pikalek said, it's also known as the Midpoint Displacement algorithm (because you perturb the midpoints of each edge) or Diamond-Square algorithm when working with a square instead ...
user1118321's user avatar
  • 2,632
6 votes

Make a place or city feel crowded in procedural generated worlds

If you don't have people in your city it's going to feel deserted. I don't think there's anything else which will substitute for having NPCs but games have used the types of NPC behaviours you've ...
Fulby's user avatar
  • 61
5 votes

Make a place or city feel crowded in procedural generated worlds

If you want a city's population to exist, but not talk to you: Have them speak a different language. Granted, it would still be weird to not speak the language, but it would be better than a town/city/...
jeromedruss's user avatar
4 votes

Make a place or city feel crowded in procedural generated worlds

A place doesn't feel crowded from everyone just standing around. Places feel busier when there is more movement and interaction. Rather than focusing on generating lots of NPCs all with unique ...
tyjkenn's user avatar
  • 2,586
4 votes

Generating a UV map for a procedural mesh

If we take as the requirements: no distortion no constraints on seam placement OK to overlap faces then we can use a pretty simplistic approach, independently rotating each face into a 2D plane and ...
DMGregory's user avatar
  • 135k
4 votes

Procedural generation of evenly distributed random points (2d)

I guess what you're looking for is what's called "Worley's Noise". An In Depth Cell Noise Tutorial (archived) It's very similar to what you're already doing. But instead of placing the points at the ...
Gato's user avatar
  • 301
4 votes
Accepted

Linear Gradient with angle formula

It looks an introduction to linear algebra is in order, or more precisely the dot product: dot(a, b) = |a| |b| cos(Theta) Why is it helpful? Because of its ...
wondra's user avatar
  • 4,930
3 votes

How can I create procedurally placed points in an infinite world?

I don't have a complete answer for you but I have some things that may be useful. Blue noise produces points that are "evenly spread" with some distance between them. Typically an algorithm such as ...
amitp's user avatar
  • 6,046
3 votes
Accepted

How to make many perlin noise function match

Do not assign a biome per chunk. Instead, compute your biome as a function of position. There are a few popular ways to do this... Compute the low-frequency levels of your height map first (the ...
DMGregory's user avatar
  • 135k
2 votes
Accepted

How do I perform interpolation between noise values sampled at a lower resolution?

Linear interpolation is the simplest way to interpolate. Here's the function for it: ...
James Westman's user avatar
2 votes

How could I render a star like those in Elite Dangerous - coronas and some sort of 3D "plasma" effect on the surface?

The texture can be achieved by using a 3d noise, like simplex noise. If you can, use a multi octaved noise (it makes the texture look rougher). Get the current coordinate of the fragment relative to ...
Bálint's user avatar
  • 14.9k
2 votes

Does anyone know what terrain generation algorithm is used here?

I've seen it referred to as 'fractal subdivision.' In this case, you assign a random height perturbation to the corners of the triangle, subdivided it at the midpoints of the edges & repeat the ...
Pikalek's user avatar
  • 12.4k
2 votes

How can I reduce the sharpness of my generated terrain?

Without knowing the specifics of your algorithm here are a couple things you can try: If you want a simple method that keeps the same highs and lows; but has a greater amount of points fall in the ...
Lunin's user avatar
  • 1,346
2 votes

Voxel Game - High Memory and CPU Usage

First of all, we can say with absolute confidence that the culprit is not your glfwSwapBuffers call. On it's own SwapBuffers doesn't do much; what it does however do is take all of the GL commands ...
Maximus Minimus's user avatar
2 votes

Volume preserving procedural mesh deformation

Due to the relatively low melting temperature of metals, they act like a fluid (sort of) when you hit them (it' closer to a gel, but gels are also fluids technically). The higher something's ...
Bálint's user avatar
  • 14.9k
2 votes

Quad sphere subdivision algorithm

Implementing LOD subdivision on terrain is quite complicated, I rather recommend to use a library or something. But if you prefer to learn the hard way here are the principal steps you need to do: ...
Cryptjar's user avatar
  • 210
2 votes
Accepted

Background generation with sprites in 2D dimension in Unity

First you need a way to generate your star prefabs. This is a simple code that creates your stars randomly: ...
Seyed Morteza Kamali's user avatar
2 votes

How can I create procedurally placed points in an infinite world?

What you want to do is take advantage of the fact that a pseudo-random number generator that uses a seed will reproduce the same "random" set of numbers every time. You can read a bit about them at ...
Tim Holt's user avatar
  • 10.3k
2 votes
Accepted

Mapping noise to sphere surface

the answer was simple enough Vector3 vector = original[i] + ((normal * noise) * amplitude); basically i want to take the "original vert" and add "some noise in ...
kei's user avatar
  • 235
1 vote

Make a place or city feel crowded in procedural generated worlds

If a NPC just impedes the player's movement that is enough for the player to acknowledge their existence. Something on the level of GTA is enough. Bonus points if the crowds are useful for the player ...
adrix89's user avatar
  • 412
1 vote

Make a place or city feel crowded in procedural generated worlds

You could stay by generating "areas" such as a market, brothel, trading post, etc. Each area could contain specific building blocks. For example the market may have stalls with vendors while the ...
Nick Savage's user avatar
1 vote

Voxel Game - High Memory and CPU Usage

when building the mesh for each chunk you can use the neighbouring chunk to see whether a face needs to be drawn. This could lead to some chunks not needing to be drawn at all. Can you try using ...
ratchet freak's user avatar
1 vote

Generation of a moon terrain

Instead of using a noise, use an algorithm, that creates the terrain. You should create every point first at a uniform height, then with a seeded random you pick a position and a radius. After you ...
Bálint's user avatar
  • 14.9k
1 vote
Accepted

Generating a UV map for a procedural mesh

The real problem here is seams. Since the question remains underspecified, here are some contrived solutions, leaving implementation specifics to you. Don't let textural features cross triangle edges....
Engineer's user avatar
  • 29.8k
1 vote

Batch/Combine multiple Graphics.DrawProcedural-Calls in Unity

Why not just collect a few buffers with different objects and direct them to compute shader? Here is a sketched quick, not tested, example (no time to create the objects themselves). Structurally, I ...
Анатолий Снеговский's user avatar
1 vote
Accepted

Adding mesh's\objects to procedural isosurface terrain

You should have the vertex positions for the terrain and some information about how they make up the triangles (like indices), and you also know the normals for each triangle. With this data you can ...
Bálint's user avatar
  • 14.9k

Only top scored, non community-wiki answers of a minimum length are eligible