• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Textures all messed up in an Fps game on Studio

So, i've imported an FPS project i've been doing for years now - started way back on GM7.0 - into Studio 1.4. However, upon testing (after cleaning up all the obsolete functions) the 3d textures appear all messed up although the game still otherwise runs just fine: for example, character sprites are appearing in tree objects in place of the leaf's texture, and other weird 💩💩💩💩 (walls have character textures etc.). Is there an obsolete 3d-function nowadays that i missed? Has the drawing system for FPS games changed a lot from 8.0 -> Studio 1.4 transfer?
Thanks beforehand
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
You'll need to tick "use for 3d" on your texture sprites/backgrounds that get tiled - older versions of GameMaker used to make a separate texture page for every image while GMS1/GMS2 default to combining multiple images into larger textures (taking up less disk space and working faster on mobile platforms where GPU might have trouble switching between textures too often)
 
You'll need to tick "use for 3d" on your texture sprites/backgrounds that get tiled - older versions of GameMaker used to make a separate texture page for every image while GMS1/GMS2 default to combining multiple images into larger textures (taking up less disk space and working faster on mobile platforms where GPU might have trouble switching between textures too often)
Ahh got it. Thanks 4 quick reply. I'll try this trick out
 
You'll need to tick "use for 3d" on your texture sprites/backgrounds that get tiled - older versions of GameMaker used to make a separate texture page for every image while GMS1/GMS2 default to combining multiple images into larger textures (taking up less disk space and working faster on mobile platforms where GPU might have trouble switching between textures too often)
another question: i checked the Used for 3d for every texture, that part works; however, when textures are overlapping each other (if they are just in front of each other in the player's view) they start clipping weirdly, and half of the texture disappears (probably under the overlapping object's texture). I found a code to solve it:

draw_set_alpha_test(true);
draw_set_alpha_test_ref_value(128);

However, i'm not sure if i should put this code in the Draw Event of every 3d object (walls and other objects), or where? Since still textures seem to sometimes glitch (disappear) strangely, after i tested by putting this code in Draw...
 
Make sure you only tick that box for textures that will actually repeat; try to limit the amount of texture swaps.

Instead of adjusting the alpha test to counter z-fighting, just don't overlap the triangles in the first place.
 
Make sure you only tick that box for textures that will actually repeat; try to limit the amount of texture swaps.

Instead of adjusting the alpha test to counter z-fighting, just don't overlap the triangles in the first place.
So it's basically to tick the Used for 3D on only for textures that repeat, like floor and wall textures, or did i understand correct? How about just sprite editor-drawn character or item textures (2D sprites that appear in the 3D rooms, kinda like 2.5D like enemies in Doom or such) ?
 
Only textures that you plan to tile need the option ticked. If you have a floor image that doesn't tile (for example, a small rug), you don't need to tick the option. A texture does not need that option ticked just because the game is 3D (technically it's all 3D anyway, but that's another story).
 
Only textures that you plan to tile need the option ticked. If you have a floor image that doesn't tile (for example, a small rug), you don't need to tick the option. A texture does not need that option ticked just because the game is 3D (technically it's all 3D anyway, but that's another story).
So, does it still work like back in 8.1, where i could just put event-less 2D-objects with grass texture as a sprite, in the 3D room with depth of 0, and they would appear in the ground in 3D as a floor when playing? I seemed to have some problems with this, didnt work anymore when imported to Studio. On objects like those, the Used for 3D box is not to be checked?
I guess i'm slowly getting a hold of it! Quite a shock when an fps game that looked great back in 8.1 turned to a texture chaos in Studio, haha.
 
Well, my point was less about how they'll draw and more about the proper use of texture pages. To answer your first question, yes. The second, I'll expand on my previous post. If you have a large floor and a sprite of a tile that you want to use, you'd check the Used for 3D box so that when you set the h/vrepeat arguments above 1, you'll get the same tile texture throughout instead of grabbing all the other sprites on the texture page. However, doing so means a specific swap because this tiling texture needs to be on its own page, which is what the Used for 3D box does. If you want to then place a rug on this floor using a sprite of a complete rug as opposed to an image designed to tile, then you shouldn't tick the option because there's no point swapping to another texture page if you are not setting the h/vrepeat arguments above 1.
 
Well, my point was less about how they'll draw and more about the proper use of texture pages. To answer your first question, yes. The second, I'll expand on my previous post. If you have a large floor and a sprite of a tile that you want to use, you'd check the Used for 3D box so that when you set the h/vrepeat arguments above 1, you'll get the same tile texture throughout instead of grabbing all the other sprites on the texture page. However, doing so means a specific swap because this tiling texture needs to be on its own page, which is what the Used for 3D box does. If you want to then place a rug on this floor using a sprite of a complete rug as opposed to an image designed to tile, then you shouldn't tick the option because there's no point swapping to another texture page if you are not setting the h/vrepeat arguments above 1.
aight, thanks again, i'll be sure to try it out when i return to my fps project. Think i got a hold of it now
 
Top