procedural-generation

Procedurally generated texture for Particle with three.js

落爺英雄遲暮 提交于 2019-12-13 03:56:57
问题 My goal is to create a particle system that involve procedurally generated texture for each particle (vertices), but I find it difficult to create a prototype of such particle system that works under both Canvas and WebGL renderer with three.js Criteria I am trying to achieve: Renderer independent (ParticleCanvasMaterial won't work with WebGL) Circular texture (ParticleBasicMaterial does not like canvas texture; unable to make it output a circle shape) Procedurally generate those texture

Eliminating (or detecting) holes in procedural noise for game development

北慕城南 提交于 2019-12-13 02:50:16
问题 I've been following this page http://devmag.org.za/2009/04/25/perlin-noise/ as a guide to create my own perlin noise - it's been pointed out in the comments section that this is FBM noise, but that's irrelevant. This is working very nicely so far, these are the results, after some 'cleaning' to remove as many artifacts as I can. http://puu.sh/dayg9/2943aca5ce.png Now that I've created my noise, I'm going to use it as an infinite map for a platform game. However, as you can see, there are some

Calculating UV coordinates during mesh extrusion

纵然是瞬间 提交于 2019-12-11 05:05:12
问题 I'm currently implementing a mesh extrusion algorithm for plane shapes, let's assume for a rectangle. When I extrude this rectangle I create four new sides (resulting in 8 new triangles) and a new bottom for the 3d shape. This works fine when I duplicate all vertices so that my final cube has 24 of them. But I'd like to avoid these extra vertices now so that I have only 8 vertices. Unfortunately, in this case I do not know how to calculate the UV coordinates and I keep getting wrong results

Making a customizable LCG that travels backward and forward

寵の児 提交于 2019-12-11 00:29:32
问题 How would i go about making an LCG (type of pseudo random number generator) travel in both directions? I know that travelling forward is (a*x+c)%m but how would i be able to reverse it? I am using this so i can store the seed at the position of the player in a map and be able to generate things around it by propogating backward and forward in the LCG (like some sort of randomized number line). 回答1: All LCGs cycle. In an LCG which achieves maximal cycle length there is a unique predecessor and

Smoothing issue with Diamond-Square algorithm

放肆的年华 提交于 2019-12-10 15:43:45
问题 I am using the diamond-square algorithm to generate random terrain. It works fine except I get these large cone shapes either sticking out of or into the terrain. The problem seems to be that every now and then a point gets set either way too high or way too low. Here is a picture of the problem And it can be better seen when I set the smoothness really high And here is my code - private void CreateHeights() { if (cbUseLand.Checked == false) return; int Size = Convert.ToInt32(System.Math.Pow

Procedural Generation of City Streets?

非 Y 不嫁゛ 提交于 2019-12-06 06:32:59
I've read up on L-Systems, read Parish & Muller and Kelly & McCabe, and tried implementing this , but I'm really not having any luck at all (all my streets tend to go in one direction, never branch, etc.). Can anyone provide some source code, or some sort of reference implementation that generates a system of City Streets (preferably along the lines of Parish & Muller, but at this point, I'll try anything). I've been working on this for weeks now, and getting nowhere fast. 来源: https://stackoverflow.com/questions/15151958/procedural-generation-of-city-streets

What languages or methods allow graphics & music demos to fit in 64kb EXEs?

我怕爱的太早我们不能终老 提交于 2019-12-05 07:23:40
How is it possible that in a 64kb compiled exe, these programs can generate such crazy visuals, complete with matching music? An example: Ars Nova By Phantom Lord ( YouTube video of the demo running ) This program's only 64kb in size! How did they do that? Are they using some sorts of pre-existing objects, shaders, etc. inside DirectX or something like that? What languages do they even use? Is there some sort of guide to this stuff? EDIT: Another mind-blowing demo. How? http://www.scene.org/file.php?file=/demos/groups/farb-rausch/fr08_final.zip&fileinfo EDIT: More demoscene stuff. I found some

Tweaking Heightmap Generation For Hexagon Grids

拟墨画扇 提交于 2019-12-04 15:03:27
问题 Currently I'm working on a little project just for a bit of fun. It is a C++, WinAPI application using OpenGL. I hope it will turn into a RTS Game played on a hexagon grid and when I get the basic game engine done, I have plans to expand it further. At the moment my application consists of a VBO that holds vertex and heightmap information. The heightmap is generated using a midpoint displacement algorithm (diamond-square). In order to implement a hexagon grid I went with the idea explained

Procedural generation of a constrained landscape

雨燕双飞 提交于 2019-12-04 08:12:04
问题 I'd like to implement a procedural generation of a terrain. After a thorough research I came up with a conclusion that it should be implemented with one of the gradient (coherent) noise generation algorithms, for instance Perlin Noise algorithm. However, I don't want the generation to be completely random. I'd like to apply some constraints (like where should be a mountain range, or where should be a lowland etc.). Question: For example I have a curve which represents some landscape element.

How is a 3d perlin noise function used to generate terrain?

心不动则不痛 提交于 2019-12-03 23:41:40
I can wrap my head around using a 2D Perlin noise function to generate the height value but I don't understand why a 3D Perlin noise function would be used. In Notch's blog , he mentioned using a 3D Perlin noise function for the terrain generation on Minecraft. Does anyone know how that would be done and why it would be useful? If you are passing x , y , and z values doesn't that imply you already have the height? Marcel Jackwerth Well, Minecraft is about Mines. So, what Notch tried to solve was: "How do I get holes / overhangs in my world?" Since 2D perlin noise generates nice/smooth looking