#Sawtooth texture in a 3D Card

44 messages · Page 1 of 1 (latest)

runic dune
#

I'm trying to make a small 3D card game with up to 4 players.

I currently have the game scene, which randomly deals 7 cards to the players' "hands," which in turn invoke the 3D card scene.

The card was designed in Blender (I don't know how to model in Blender, lol) and it's just a 2x3x0.1 "cube" with slightly beveled corners (and yes, I could have used a plane, but I wanted a cube, let me 😾).

NOW, the card itself has a default flat white texture all around. Then, in code, depending on the resource (type of card), I apply a .png to one side and another .png to the other.

PROBLEM: The card looks "bad" depending on the side. You can see huge jagged edges, and if you turn it face down, the back texture looks super blurry.

sudden flint
#

I’m going off of my knowledge of importing 2d sprites, but you might want to use higher resolution textures. Typically jagged artifacts like this happen when your texture is being stretched and resized.

#

With more pixels in the texture, the anti aliasing will be less visible

#

Oh and make sure the PNGs you’re using are all the same size

bright gulch
#

This may have to do with how your UVs are laid out as well, I don't know what your UV map looks like, but if there's weird angles, it could cause pixels do that when rendering for sure

runic dune
#

Could you take a look and tell me if there's anything strange?

#

oh and this is the texture~

bright gulch
#

Out here using shading nodes and all

#

Oh I see so you have one side on a different material, but they're basically using the same UV map, got it.

#

Do you mind if I just go and simplify this a bit?

#

Your UVs are fine btw, I think this is a sampling issue in the engine for sure, the textures seem reasonable

runic dune
bright gulch
#

yeah, reasonable I'd say for sure

runic dune
#

Maybe there is some "antialiasing" I can apply to the model in Blender so that when I import it it looks good?

bright gulch
#

I Think it's more of a godot issue here. import settings, something like that.

When it comes to materials, usually what I do is override materials in godot anyway, because I feel it's easier to have more control over them, you can do fancy stuff like set up shaders and stuff, and do things that don't carry over from blender.

#

But anyway yeah let me pop this into godot and see how it imports

runic dune
#

I also thought it could be something in the material, but again, I don't know about Godot and 3D haha, So I wouldn't know what to play to start with, not without accidentally breaking everything~

runic dune
bright gulch
#

I think I'm seeing what you mean in some cases.

So for the edges, I'd recommend not beveling the images and adding transparency. Since the model is already beveled, you're not gonna see that area anyway, and when the model's being rendered, it's trying to sample that area, and can sometimes try to smooth it, but smoothing into transparency can lead to something like this black thing.

As for the other edges loading I think it's a sampling issue so I'll poke around settings

runic dune
#

Oh okay, I'll try not to do it with transparency then, but still, I wouldn't understand why that makes it look VERY bad when you rotate the card specifically face down.

bright gulch
#

oh I'm not getting any issues with rotating, yeah that I suppose I'd expect to be a problem with antialiasing or something

#

I am getting weird pixely edges on this texture and I'm poking around to see how to resolve it

#

Setting sampling to nearest shows that it's not a lot of pixels to play with in this area though, so it certainly could be you just need an even bigger texture

#

in-game with a few antialiasing settings on and linear sampling, it looks kinda fine. this is probably way larger than I'd really expect a card to show in game honestly

runic dune
crude horizon
#

maybe don't compress the texture

runic dune
bright gulch
#

Oh that one? I think that's a mipmapping thing

runic dune
#

remaked texture (but i can re-scale the texture if need more px)

#

I made it 1024x1536 instead of double that, thinking it wouldn't be too graphically intensive.

PD: Want to say, due to the type of game, scenarios with a thousand cards on screen are possible~

runic dune
bright gulch
#

Godot for sure, check its rendering settings and poke around in there. You might need to change your rendering backend, not sure if the compatibility mode has all the features you need to really tweak things nicely for what you might want

#

I'd look into antialiasing and anything mipmapping related. 🤔 It might be a field on materials even actually

#

I have a Surface Material Override on the mesh here to override that particular material, with the texture set, and I'm just messing wit h that

runic dune
bright gulch
#

Not really. Some of those options look better than others but like functionally think about what's happening. A texture is getting squashed into a few pixels, it's gonna have to do something there and nothing is going to look like the card straight on

runic dune
#

Good morning. Can't you apply a filter or shader to smooth everything out? Everything looks worse when in full screen on the PC (the default is 1280x720, since it's also intended for use on Android, but on the PC it scales to 1908x954 at maximum).

runic dune
#

I've tried a combination of multiple things and it certainly looks better, not 10/10 but an 8 or 9/10 ~

#

I don't know why no one ever suggested to me, neither here nor in other forums, that I increase the size of the viewport x'D (720 to 1080)

#

(and yes, I asked, but they told me to move the rendering from linear to nearest instead)