Tag Info

Hot answers tagged

6

Basically, I think what you do is first of all create a tile for each of your terrain types that seamlessly tiles with itself. As you said there are many tutorials available on how to do this. Once you have those tiles, you can draw variants as well as transitions between different types of terrain by modifying copies of them. The only thing you need to ...


2

To apply different textures based on height the general method is to, in a pixel shader; Find the height of the geometry at the current pixel position. Perform a texture lookup on the heightmap that defines the geometry or just find the position of the current geometry as you would for lighting and find the y component. Supply your shader with some kind ...


2

You need to combine texture atlas techniques with your existing triplanar shader so that you can easily switch the "textures" being used based on the terrain type in the voxel. One technique if you are using shared vertices between voxels might be to use vertex color or UV coords to encode all the terrain types associated with a particular vertex, then you ...


1

i do believe changing the color would be much less resource intensive, however the performance depends more on the number of different textures used. check out this article for a few good bits of ingenuity when it comes to managing textures and performance http://www.gamasutra.com/view/feature/131768/understanding_and_using_opengl_.php?print=1 my take ...


1

You can use Texture2D.GetData() to copy texture pixel data to a Color[] in XNA. Texture2D texture=Content.Load<Texture2D>("asd"); Color[] tcolor=new Color[texture.Width*texture.Height]; texture.GetData<Color>(tcolor); After you have your Color array, you can do whatever you want with it, for example you could change certain colored pixels to ...


1

How about: vec3 delta = abs(textureColor - vec3(0.85, 0.85, 0.85)); // Get delta from middle vec3 if (delta.r <= 0.05) && (delta.g <= 0.05) && (delta.b <= 0.05) Performance needs to be profiled, but it's sure shorter to write


1

You get the black boxes because you have to enable blending in OpenGL: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); This because the textures drawn by Slick have transparency.


1

You could do this: Create a texture holding all the colors you want. For the actual button geometry, set the texture coordinates to the appropriate region of the color texture (they can all be the same value, in fact).


1

Well, i'd probably start by taking a look at the blender unwrapping code, since blender is some open souce flavor; it appears to start here: https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/uvedit/uvedit_unwrap_ops.c I know the have a "pack lightmaps" command in their uv unwrap menu, but I wasn't able to locate it in unknown ...


1

You are going to have background rendered either way. OpenGL redraws the whole frame each time. So what does it matter for performance where are you drawing it from? :) It does not matter, unless you are doing some heavy computations to generate the background on CPU. What you probably do is just updating the background location each frame (position, ...



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