Tag Info

Hot answers tagged

3

1. Creating textured model in Blender First, add a new texture by going to texture panel on the right. Select type "Image or Movie", click "Open" and locate your texture file. Then, move your mouse to the 3d view, press Tab to select the default cube, then press "U" and select Unwrap. Go to UV Image Editor: and select the texture: At this point, the ...


2

I don't think it's possible to specify a source pitch for the buffer in CPU memory like you could with a lower level API. However, you can specify an offset into your pixels using a DataView, so you could upload a 1000x100 portion of the texture that way.


2

Try turning off backface culling. In your shader, put "Cull Off" in the "SubShader" section.


1

This is an old topic, and I had a similar problem to the topic. I had my texture coordinates just fine, but by lerping the camera position (which changed my element's positions) like so: public static void tween(Camera cam, Direction dir, Vec2 buffer, Vec2 start, Vec2 end) { if(step > steps) { tweening = false; return; } ...


1

If you want to use it as sprite then change the import settings 'Texture Type' to 'Sprite(2D and UI)'. This will bring it back to its original dimensions. If you want to use it as texture then this wont matter, the texture depends upon the 3d object UV mapping, so it will scale properly. For particle you can convert the entire image to have square ...


1

Yes! I have figured it out. LWJGL texture files must have dimensions equal to powers of 2 (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048 etc). Otherwise OpenGL will clamp them to nearest power.


1

As described here (last chapter), please check the value of the field renderCalls in your SpriteBatch (you have only one unique SpriteBatch instance right ?), this should tell you the real number of draw calls that the batch has made. If you have more renderCalls than what you would expect then maxSpritesInBatch value is too low or your sprites have ...


1

Some ideas: You could ignore the issue, and do what you're currently doing. Assuming those texture and shader comparisons are to OpenGL IDs (which are just integers), it's unlikely those checks are going to create a huge performance bottleneck. Comparison of integer values on modern CPUs is rather fast. Unless your profiler has told you this is currently a ...


1

What a dump question. I put the cubemap to the wrong samplerCube. I assigned the map to cubemap[1] not cubemap[0]. Great example of "I wouldn't do something like this. The error must be somewhere in the OpenGL code!" :D


1

Terrain has a "setAlphaMaps" function you can use to modify the terrain splat maps at runtime. You can find the documentation (along with an example) in the official unity documentation here: http://docs.unity3d.com/ScriptReference/TerrainData.SetAlphamaps.html Just make sure you call Terrain.Flush when you're done. As your target is a vector3 you will ...


1

The solution suggested by Sebastian would work, but you'll end up with a lot of code just for a "fade out/fade in" animation. Libgdx has built-in functionnalities for that in Scene2D, you should use them. (Actions, Stage, Actor) That would make your code as simple as that : myPlayer.addAction(Actions.sequence(Actions.fadeOut(0.15f), ...


1

Why not set the alpha value of the sprites directly via sprite.setAlpha(float)? Of course you would have to call that by your rendering method and calculate the amount of alpha alteration using deltaTime. https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/Sprite.html#setAlpha-float-



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