heightmap

How can you stitch multiple heightmaps together to remove seams?

僤鯓⒐⒋嵵緔 提交于 2020-02-06 00:49:20
问题 I am trying to write an algorithm (in c#) that will stitch two or more unrelated heightmaps together so there is no visible seam between the maps. Basically I want to mimic the functionality found on this page : http://www.bundysoft.com/wiki/doku.php?id=tutorials:l3dt:stitching_heightmaps (You can just look at the pictures to get the gist of what I'm talking about) I also want to be able to take a single heightmap and alter it so it can be tiled, in order to create an endless world (All of

How can you stitch multiple heightmaps together to remove seams?

蓝咒 提交于 2020-02-06 00:49:15
问题 I am trying to write an algorithm (in c#) that will stitch two or more unrelated heightmaps together so there is no visible seam between the maps. Basically I want to mimic the functionality found on this page : http://www.bundysoft.com/wiki/doku.php?id=tutorials:l3dt:stitching_heightmaps (You can just look at the pictures to get the gist of what I'm talking about) I also want to be able to take a single heightmap and alter it so it can be tiled, in order to create an endless world (All of

SceneKit shader modifier for geometry entry points works in iOS but not OS X

*爱你&永不变心* 提交于 2020-01-23 13:30:13
问题 I'm in the early stages of making a SceneKit shader modifier (for the geometry entry point) that displaces a plane's geometry according to a height-map texture. The plan is to use it for creating terrain. In iOS (edit: the iOS Simulator) the shader works as it should, but does print this warning to the console: SceneKit: error, modifier without code is invalid When building for OS X however, the shader gets a fatal error, and the terrain geometry just displays as a pink rectangle. This is the

GLSL shader: Interpolate between more than two textures

本秂侑毒 提交于 2019-12-20 10:56:03
问题 I've implemented a heightmap in OpenGL. For now it is just a sine/cosine curved terrain. At the moment I am interpolating between the white "ice" and the darker "stone" texture. This is done like this: color = mix(texture2D(ice_layer_tex, texcoord), texture2D(stone_layer_tex, texcoord), (vertex.y + amplitude) / (amplitude * 2)) The result: It works fine, but what could I do if I want to add more textures, for example a grass texture, so that the interpolation order is "ice, stone, grass"? I

Implementing a 32-bit heightmap vertex shader in threejs

帅比萌擦擦* 提交于 2019-12-20 06:57:43
问题 I am attempting to repurpose the heightmap shader example found here into one that will work with 32-bits of precision instead of 8. The work-in-progress code is on github: https://github.com/bgourlie/three_heightmap The height map is being generated in .NET. The heights are within 0f...200f and converted into a 32-bit color value (Unity's Color struct) using the following method: private static Color DepthToColor(float height) { var depthBytes = BitConverter.GetBytes(height); int enc =

Implementing a 32-bit heightmap vertex shader in threejs

安稳与你 提交于 2019-12-20 06:52:30
问题 I am attempting to repurpose the heightmap shader example found here into one that will work with 32-bits of precision instead of 8. The work-in-progress code is on github: https://github.com/bgourlie/three_heightmap The height map is being generated in .NET. The heights are within 0f...200f and converted into a 32-bit color value (Unity's Color struct) using the following method: private static Color DepthToColor(float height) { var depthBytes = BitConverter.GetBytes(height); int enc =

make seamless height-map texture for sphere (planet)

蓝咒 提交于 2019-12-17 21:34:28
问题 I'm trying to generate height-map for spherical planet with perlin noise. How can I make it with seamless left/right borders? I smoothed heightmap in poles, but cannot understand how can I loop left and right sides. This is how my textures look liked for now: 回答1: Mirroring (by y-axis) This is great for making seamless background textures. But as you mentioned the texture must not contain distinct patterns otherwise it would be obvious. This can be used as a start point for texture generator

Threejs make a displaced mesh (terrain model) [closed]

梦想与她 提交于 2019-12-14 03:28:33
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . So I have around 59k data points that I'm visualizing. Currently I'm making them into a texture, and then applying them to a plane geometry. Now the issue is that I need to show a heightmap, each datapoint has a height value, and I need to apply that to the mesh. How is the

WebGL heightmap using vertex shader, using 32 bits instead of 8 bits

元气小坏坏 提交于 2019-12-11 07:03:56
问题 I'm using the following vertex shader (courtesy http://stemkoski.github.io/Three.js/Shader-Heightmap-Textures.html) to generate terrain from a grayscale height map: uniform sampler2D bumpTexture; uniform float bumpScale; varying float vAmount; varying vec2 vUV; void main() { vUV = uv; vec4 bumpData = texture2D( bumpTexture, uv ); vAmount = bumpData.r; // assuming map is grayscale it doesn't matter if you use r, g, or b. // move the position along the normal vec3 newPosition = position +

Threejs deform mesh from heightmap

泄露秘密 提交于 2019-12-08 15:24:27
How can I go about deforming an already created mesh with a heightmap in three.js? I did a few searches and couldn't find anything, so I'm asking here. You are lucky, three.js-r72 introduced vertex displacement in the MeshPhongMaterial . You set the displacement map like a normalMap : var displacementMap = THREE.ImageUtils.loadTexture( "textures/ninja/displacement.jpg" ); var material = new THREE.MeshPhongMaterial( { color: 0x0a0100, //... displacementMap: displacementMap, displacementScale: 2.436143, displacementBias: - 0.428408, } ); scale : The amount of displacement, "how tall are your