Tag Info

New answers tagged

3

Solution 1: Rotate your UVs in your fragment shader The fragment shader is where texture sampling occurs, based on the UV values of your fragments. For every fragment, an interpolated UV value is calculated (as the interpolation of the vertex UVs of the vertices of the corresponding). The UVs are a 2D coordinate pair with values ranging from 0 to 1: [0, ...


0

I'll post the answer as the question is related to my previous misunderstanding of how textures and texture units work. You can load as many Textures as you want into the OpenGL memory, all assigned to Texture Unit #0. OpenGL always returns a new handle for each of these textures. When applying the texture, you just have to bind to the appropriate handle ...


1

Without immutable storage you can just specify a texture array using glTexImage3D. I note that you say you've tried this but it didn't work; it would have been helpful if you had given us the code that didn't work, as you clearly have an error in it which we may have been able to help you with. That aside, there is another way which is minimally invasive ...


0

Texture arrays have been part of the OpenGL core context for as long as there's been a core context; ever since OpenGL 3.0. Pretty much every desktop computer sold within the last six years will support OpenGL 3.0 or later. Ultra-mobility laptops more than three years old might be problematic, but anything more recent or more beefy than that should be ...


0

are you drawing your texture in the back buffer for updates but still storing the texture? if the texture was destroyed from memory thin it will have to be reloaded in to the back buffer are you changing the texture to a new texture? draw the texture in to the back buffer so on next update there texture will update thin remove old texture from memory


0

Graphics APIs have a function called "backface culling" where they omit drawing any triangle which is facing away from the viewpoint. This is determined by looking at the winding order of the vertices after projection, classifying them based on if it's clockwise or counter-clockwise. There is a mismatch between the winding of your source geometry and the ...


0

There are overloads for Texture() that allow you to pass a Pixmap.Format. The list of formats is quite limited. Per OP: texture = new Texture (Gdx.files.internal ("gs.png"), Pixmap.Format.LuminanceAlpha, true);


0

Doing this manually is insane. You need a tool that will take a folder full of images, pack them into atlases AND write a file containing all the coordinates. So then in your game you could address any image by its index or name or whatever and get its atlas coordinates (in pixels or UV).


0

As far as I know, for accessing bitmap's pixel data, you should use LockBits() function: https://msdn.microsoft.com/en-us/library/5ey6h79d(v=vs.110).aspx Something like this: var bitmapData = scaledBitmap.LockBits(...); var length = bitmapData.Stride * bitmapData.Height; byte[] bytes = new byte[length]; // load image ...


1

If you extend AssetPostprocessor you can receive a callback(OnPostProcessTexture) when a texture import is completed. You can use that entry point to automatically create a new material and assign the relative texture to it.


2

Scripts put in a folder named Editor affect Unity's editor, rather than running when you play the game. You can use this functionality to extend the capabilities of the editor, to run custom functions you create. For example, here's a script that adds a window with buttons for custom functions: http://wiki.unity3d.com/index.php?title=FindMissingScripts You ...


0

You are creating a rectangular "viewport". The first line sets the width and height of the rectangle. The second line translates it to the correct tile. If all of your tiles are 128 wide and the texture is 1024 wide then each tile is 128/1024=0.125=12.5% of the overall width and 128/128=1.00=100% of the overall height. You can think of this as applying a ...


0

I think what I need is a vertex collapse algorithm that is typically used with reducing excess polycount. http://pomax.nihongoresources.com/downloads/PolygonReduction.pdf but create a different cost formula.



Top 50 recent answers are included