Hi.
I have a problem with texturing assets when I build for UWP for Xbox.
The problem I have is about using texture 2d array.
I have a texture with 16 tiles arranged as 4x4 tiles on a 8k texture.
When I build for windows all is just right.
If game is built for UWP I have a strange uv offset on every mesh.
But this offet occurs only if index for texture atlas is greater than zero.
If texture atlas is 1x1 or index is zero, all looks ok.
Does anyone know what is happening ?
I was trying to use dx11 / 12, different shader setups and went to the simplest
possible shader with just one texture for all meshes as diffuse.
I’m running out ( I run out already ) of ideas what might be causing such result.
All export is with those settings :
Images in attachements:
When index is zero: Editor ( left ) Xbox ( right )
When it is not zero : Editor ( left ) Xbox ( right )
Texture setup
Sorry for low quality of some of them as I took pictures from the screen.
Somewhat I couldn’t get screenshots directly from xbox.
Maybe because of Devkit mode ?
Any help is more than welcome
after some investigation I have discovered there is an uv offset on U axis:
So this could be one of two things :
- there is some additional offsetting done to all meshes when project is built as UWP
- there is some texture offset if 2d array is in use when project is built as UWP.
However, if I use regular texture ( not an array ) there is no issues at all.
So there must be something with the Texture2DArray node in the Shader Grapth.
If used along with UWP build, such texture offset is happening.
And another step to figure this out.
I used Unity box as a test mesh, to remove custom user data from the equasion.
Looks like there is some issue with texture2darray OR all meshes uvs are moved
to the side on uv space.
Editor ( left ), Xbox ( right )
aaaand another find:
if texture size is set to 256x256 then all looks good !
Editor ( left ) , Xbox ( right ):
This example shows how it looks like with 512 texture with no filtering:
Those black areas are present but each time they have different “configuration”.
Here with texture set to 2kx2k:
So my assumption is this: offset is 256px or by value which is relevant / propotional to 256 px like 1/8th of 2k texture.
If texture is 256x256 and offset is by 256 pixels, all looks good as offset is by 1 then.
If it is 512, then offset is by half, 1k - by 1/4 and so on.
The larger texture is, this offset is smaller.
And the last one:
If texture array has 1 row and multiple columns then setting index
as the last one in the array makes all working just fine.
editor and Xbox :
But only last index will work, if it is somewhere in the middle of the array the result is broken.
So fir now all my test UWP builds will have “correct” texture sizes ( 256px ) until it will be not fixed or I will not find any workaround.
I could use regular texturing method, but this one is part of greater pipeline I’m making.
I’m using Unity as it is the only engine out there which allows me to make and test
games on something close to “big gamedev” environment.
I have enough. Please help.
Turned out it is a bug. UUM-83220