New answers tagged

2

At least i have found the solution. It includes 2 step : 1- My surface texture wraping was wrong. X axis must be repeated and Y axis must be clamped to edges. The correct one is: surfaceTexture.setWrap(Texture.TextureWrap.Repeat, Texture.TextureWrap.ClampToEdge); 2- When we use "ClampToEdge" wrapping, texture's Y coordinates must be between 0 and 1. So i ...


2

Your code isn't wrong at all. You are dealing with matrices and vertices the right way (your 3D simulation actually works), and even texture mapping is fine. Matter is, your texture mapping algorithm uses just a linear interpolation to map a point in the 3D space to a point in the 2D plan of a given texture. Texture mapping When mapping texture to mesh ...


0

As always, I think the answer is in between. You can dynamically patch your texture atlas and just draw with multiple atlases if the first one runs out of space.


1

As noted in the comments above, performance is going to depend on implementation, your particular hardware, and what you're trying to do with the textures, so the only reliable answer there is to profile each alternative. There are a few differences in terms of how you use each option though, which will apply consistently: One big difference is that, for ...


1

Okay it took some researching but apparently my software I was using don't do all the heavy lifting. You copy & paste the roughness into the alpha channel of the specular/metalness texture which will do the trick (the RGB channels must be off though). I discovered the reason for this is. White = Solid Black = Transparent This technique must be used ...


0

So I at least figured out a fix for some reason, my toon shader is just acting up and the regular unity shaders are doing just fine, so my first guess is that the toon shader is just not up to date. If I find out anything else I will post it here.


1

Try using a different shader on your material. Unlit/Transparent should do the trick, though without any lighting.


0

If you're willing to restrict yourself to drivers which expose Bindless Textures you can make all the textures you want resident, put their handles in an uniform or structured buffer as sampler2D values and use those transparently in your shader. If not, you could have a series of texture arrays, one for each size and in your shader code branch to select ...


2

What user1118321 says is true -- all the textures need to be the same size. But that doesn't mean you need to USE all the space. For a small set of standalone textures, it's not a big deal to waste some space. You can simply store the U/V coordinates of where a smaller texture ends and use that. When creating the array, just set a max size and make ...


1

I'm not sure what you mean by "so I only make one glBindTexture call throughout a scene." What advantage does that get you? 2D texture arrays require the textures to be the same size. I don't know of any way around that. One other option you have is to use a texture atlas. You can make a single texture that contains all of your assets and simply pass the ...


0

In glsl, the texture function returns a vec4, thus you provide too much arguments to the vec4. It should be color = texture(sampler, texCoord); To avoid issues like this, always print out what glGetError returns. Second problem: Guess what GL.ShaderSource takes in as arguments. A shader, and you provided a shader program to it.


-2

Line 5 and 6 of LoadShaderProgram() contain a copy/paste error. GL.ShaderSource(program, VSSource); GL.ShaderSource(program, FSSource); Should be instead: GL.ShaderSource(vshader, VSSource); GL.ShaderSource(fashader, FSSource);


3

It looks like the issue is that you are doing non uniform scaling (different scale on x and y axis) and using nearest neighbour texture sampling. If you switch to using uniform scaling and/or bilinear texture sampling (or better, like bicubic) the problem should go away.


0

I would do both. I would make separate arms, legs, body, and head classes and keep track of them all within a player class. This way, in your Game1 class and other classes, the player is treated as ine object, but within the class, the body parts are treated separately. Hope this helps!



Top 50 recent answers are included