3D Empty space when repeating texture GMS [SOLVED]

jucarave

Member
Hello everyone (first post on this new forum), I'm having an issue while trying to apply a texture to a geometry in GMS

I have a texture that is 32x128 (valid power of 2) with the option of "Used for 3D" but when I apply it to a geometry with repeat it doesn't get applied correctly:



If I change the texture to 32x64 or 64x128 then it works:



I don't quite understand why is happening, I don't have any custom shader or anything...

Thanks for your help :)
 

jucarave

Member
I really doubt it has to be square, openGL only specifies that the texture has to be power of two but as far as I know it doesn't says anything about the relation between width and height.
 

jo-thijs

Member
Hm, I can't find anything on it anymore.
I'm guessing it was an old requirement that's no longer necessary by now.

How do you draw the walls?
 

jucarave

Member
I don't have the source code at this moment but this is what I do:

I create a model in a "world" object, then I apply the geometry to that object (I tried with the d3d_model_block and by creating the vertices manually with d3d_model_vertex_normal_texture with the same result) and then draw it by d3d_model_draw.

I can paste the full code later.
 

jucarave

Member
Ok I finally understood what was happening:



The problem is the texture page, even though I activated the "Used for 3D" option in the background properties, GM seems to move the background to an isolated texture page; with the function "background_get_uvs" I saw that the coordinates for the texture were: {0.06, 0, 0.56, 1} not {0, 0, 1, 1} So If I use those coordinates in a shader and do a module for the repeating I get the results I want, this is very annoying but on the other hand, now I can deactivate the "Used for 3D" option and have GM pack all the resources it can together (I think).

Anyways, thanks for your help.

Greetings
 
Top