New answers tagged

0

A background really isn't anything but an image that you draw before anything else. The easiest way to do that is to import the image using image.load() and save it to the variable background. After doing that create a new variable background_y that saves the position of where the background is. After that, go to your update function and decrement ...


1

There's also DXGI_FORMAT_B8G8R8X8_* formats - explicitly no alpha, but still you must expand 24-bit image into 32-bit texture when loading data. In Direct3D11 24-bit and 16-bit formats are gone for good.


2

You can render a quad onto the framebuffer with a shader that will just set the color value to 1000.0. Since you don't even need to set a texture really let alone compute lighting, this should not really take any noteworthy time to accomplish. It's pretty easy to do but here is a tutorial that talks about rendering to a texture. Though really you don't ...


0

You need to be careful, wavefront files and gpu does not works the same, in the file, you can have a missmatch of indices between position, texcoord and normal because they can be reuse differently. Extreme example, a cube with a texture per face only need 8 point values, 4 texcoord values and 6 normal values. Now, on the GPU, a vertex need to be a full ...


0

Strange bug, after slight editing of image, and saving image as png again, exception dissapper. During debug of application i saw TExture constructor call PixMap constructor and send FileHandle of file as argument, constructor read bytes from image (dont know correctly or with errors) then those bytes go to Gdx2DPixmap(bytes, 0, bytes.length, 0) and that ...


0

I am also picking tile variations based on a tile's eight neighbors. Encoding the neighborhood is fairly simple, but deciding what pattern each set of bits represents is kind of tricky. I currently just have collections of matching ints for each pattern, and I am checking each pattern type for containment. I do have the impression that a Binary Trie could ...


13

I have been able to do this using the 3d modeling software Blender. I used UV mapping to map the texture and the displacement modifier to apply the height map. If you need some form of XNA code for this, I cannot supply it. Here it is as a 3d terrain. Surprisingly, it worked best on a uniformly square mesh. The steps required to create the terrain like i ...


6

A basic height map can be produced as follows: Generate a set of vertices that form a grid made of triangles in a regular pattern like A -- B -- C -- ... | \ | / | \ | \ | / | \ D -- E -- F -- ... | / | \ | / | / | \ | / ... ... ... Each of A, B, C, et cetera represents a vertex in the grid. It also represents a point on the height; ...


1

For no apparent reason, you are filling your loaded image with a solid white color using SDL_FillRect. Also, you seem to clear the renderer without rerendering the texture. You need to SDL_RenderCopy the texture again after clearing the renderer.


1

It's hard to know what's going on without images or code so not sure if this addresses your particular issue or not, but 'Linear' in this context means that OpenGL applies a bilinear filter to the texture when it is sampled. A bilinear filter is an average of the pixels from the original image around the sample position so you may get slightly blurry ...


0

It turns out that the .obj file exported by Cinema 4D was broken. Using Blender or anything else to create the .obj file seems to solve the issue.


2

I you look carefully your cube in Cinema4D, the top most corner show different texture coordinate for the side and the top ( probably the same between front and right side, but the texture can't let me state it for sure ). And in your final cube indices, you only have a range [0..7]. On the GPU, a vertex is a full tuple of values with a single index. It ...


0

Texture2D constructor has textureFormat and mipMap arguments. So create texture with options needed and set your pixels you want.


0

A uv map maps a point (x,y,z) in the mesh to a point (u,v) in the texture image. Since an image maps (u,v) to a color, the two maps can be chained, yielding a map from the mesh space to the color space. uv map color map (x,y,z) -> (u,v) -> color mesh Texture space space


2

This isn't really a THREE.js problem (although THREE.js may limit your options for a solution); it happens with any terrain implementation of that type. From the screenshot, it looks like you're using a regularly-tessellated grid of geometry where each vertex is mapped to a height map point. Such a grid generally generates triangles in a pattern, for ...



Top 50 recent answers are included