TextureArray bug?

Hi,
I am implementing texture arrays. The problem is that the textures dont seem to wrap according to the settings.

Code snippets as follows…

TextureArray dmta=new TextureArray(dma);
dmta.setWrap(Texture2D.WrapMode.Repeat);

material.setParam("DiffuseMaps",VarType.TextureArray,dmta);

frag…

if i just use the following the surface is blank…

vec4 diffuseColor1=texture2D(m_DIFFUSEMAPS[1],texCoord1);

To make it work I have to do the following…

vec2 tc1;
tc1.x=fract(texCoord1.x);
tc1.y=fract(texCoord1.y);
vec4 diffuseColor1=texture2D(m_DIFFUSEMAPS[1],tc1);

Why doesnt the wrap mode work in texture arrays?

is wrap mode legacy from the Texture object that just is not implemented in TextureArray?

It would be nice to know the answers to these. The work around code is fine but I would like to put my concerns of “is this the correct way” to bed.

Many Thanks
Penny

I had at some point I had repeating texturemaps in arrays, but this is quite a while ago, when they were new.

I realise now that the TextureArray is not being passed to the frag.

Here are the code snippets…

j2md…

MaterialParameters
 {
 Texture2D DiffuseMaps
 Texture2D HeightMaps
 }

vert…
nothing declared or any mention in regard to maps.

frag…
uniform sampler2D m_DIFFUSEMAPS[6];
uniform sampler2D m_HEIGHTMAPS[6];

I cant seem to find an example of implementation. What am I doing wrong?

Many Thanks
Penny

I tried changinh the materialParameters from Texture2D to TextureArray with no errors and no change in results.

There’s an example on how to use them here:

Sorted thank you.

The wiki & documentation have lots of broken links which makes it difficult to understand some aspects. I will retain the link to the examples for future reference.

Many Thanks
:smile:

Do you know of any specific pages which have issues with links?

It may well be user contributed content links that are broken. I especially notice a lot by mifth. All the links to the shaddow blow project are defunct or the location does not hold the source. If I come across any links that are broken I will keep you informed.
Regards
Penny

Just so you know, you can login onto the wiki with your credentials and modify any pages.

1 Like