Advertisement

3D Orthographic Objects and Texture Quality

Started by July 09, 2022 12:34 PM
8 comments, last by Thaumaturge 2 years, 4 months ago

In my current project, the game-world is viewed from a somewhat-distant orthographic perspective (sort of; I've confessedly taken a bit of a weird approach to it).

Now, the environment itself looks fine I think (at least as far as I've thus far taken it), but I'm finding myself a little uncertain in the matter of handling smaller objects--things like characters.

Specifically, I'm finding that, presumably due to one or both of small on-screen size and mip-mapping, textures often become rather blurry, making it hard to produce decent-looking visuals in them.

So, my question: How might go about improving the quality of the final rendering in such objects? Would smaller textures be better? Bigger? Or is it just a matter of making sure that I have large swathes of solid colour, regardless of size? Or something else again…?

(The actual art-style that I go with, including what I stylise and how, is still a work-in-progress, but one that I'm relatively comfortable with taking on myself for now--at least once I know what I'm doing with the textures that will carry that art-style.)

I will say that I do think that 2D sprites might be preferable to 3D objects for such a projection, at least in terms of visual clarity. However, 2D animation is not a strong suit of mine, and can I think be a particularly long process. So, for now I intend to stick with 3D.

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Thaumaturge said:
Specifically, I'm finding that, presumably due to one or both of small on-screen size and mip-mapping, textures often become rather blurry, making it hard to produce decent-looking visuals in them.

You could experiment with manual texture lod, so you get more crisp textures at the cost of some aliasing.

Thaumaturge said:
So, my question: How might go about improving the quality of the final rendering in such objects?

Thaumaturge said:
So, for now I intend to stick with 3D.

You could render characters at higher resolution, then downscale and composite with background. I guess you could afford this performance wise, so this gives you most options for high quality anti aliasing and sharpness, without digging into rabbit holes to fake the same thing at better performance (e.g. TAA). MSAA might still be worth it additionally.

Thaumaturge said:
Or is it just a matter of making sure that I have large swathes of solid colour, regardless of size?

Maybe. But for art advice, you'd need to show some of your background concepts.

Advertisement

Thank you for the response. ^_^

JoeJ said:
You could experiment with manual texture lod, so you get more crisp textures at the cost of some aliasing.

Hmm… It's a possibility, but I'm loath to do so with quite so many textures, I fear…

JoeJ said:
You could render characters at higher resolution, then downscale and composite with background.

That's an interesting idea, and I suspect that the game can handle the additional rendering. One to keep in mind, I think.

JoeJ said:
Maybe. But for art advice, you'd need to show some of your background concepts.

Well, I'm thinking there less in terms of art-style than in terms of what would work on a technical level: that large areas of solid (or near-solid) colour should suffer less from being scaled down than likely would areas with lots of variation in colour.

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Thaumaturge said:
Well, I'm thinking there less in terms of art-style than in terms of what would work on a technical level: that large areas of solid (or near-solid) colour should suffer less from being scaled down than likely would areas with lots of variation in colour

Ah yes, sure.
Basically, if you want some characteristic edge to be 2 pixels wide on screen, but your models may also be used for close up views so need more detail, you would need to figure out a scaling factor to know how wide 2 pixels are related to your geometry and texture solutions. And then, when making the art, you know that's the spatial frequency where you want to add your most characteristic designs. Anything smaller, e.g. some detailed dirt or patterns, should have low contrast. So those extra details still aid the close up views, but add no noise to the default zoomed out view.

In practice, you can just zoom out your models and textures constantly while making them. So no need to figure out such scaling factor exactly.

Personally i do this all the time anyway, but at multiple zoom levels. Ideally, the artwork is recognizable at any scale. If we make a cover for a music album, we want the name of the band to be easily readable no matter if it's a thumbnail image on a web store, or a big vinyl album cover in the hands of the customer. We also want the face of the musician to be recognizable, while it's ok if our list of hit tracks, written in small letters, is not readable on the webshop. Our list of priorities here is artist name > artist face > track list.

We can relate the task of designing the cover to something like a fourier transform, or the fbm way of summing sum up noise functions at increasing frequencies but decreasing amplitudes.
We could also use a sampling theorem to proof that high frequencies get lost as we zoom out, or if a potential customer looks at a record just for a moment, or if a gamer has to deal with fast changes on screen.
The obvious conclusion is that we want to represent important things at lower frequencies / bigger scales, and not so important details can be some eye candy, but we don't want too much of it so it becomes noise, and we don't use them to show important information.
Now we don't always have control of which details at which frequencies appear in our artworks, but if there is a problem, we often can fix it by reducing / increasing contrast, to tone them down or up in a way our intended message stands out.

This gives us the general guideline to have low variance in high frequencies, and high variance in low frequencies, to get recognizable and scalable artwork.

However, this helps us to prevent mistakes, but it does not yet help to create better art which stands out.
To do so, we may violate or exaggerate such guidelines. E.g. a comic artist may draw backgrounds with more abstractions and thinner lines than the characters. Or a game level may use monochrome, blocky walls with subtle gradients of lighting, but colorful, detailed characters, so they are easier visible.
But i like to relate this as well to math. I imagine we have a limited amount of energy, representing attention. And then we solve some optimization problem to distribute this energy, so it focuses on spots of interest. We make the interesting parts more detailed, with higher contrast and expression, so it separates clearly from the subtle background. If we have too many spots of interest, we first need to reduce their number, because attention is finite. We can not guide it everywhere, and we need priorities and compromises.

… Probably not the 'technical level' you expected to hear. ; )

Hmm… It's a possibility, but I'm loath to do so with quite so many textures, I fear…

I meant a global setting, not individually per texture. Just to have everything a bit sharper.
Though, not sure when this is actually a win. Personally i prefer smooth over sharp images, but many people love crisp and gritty stuff.


I think that I see what you're saying, and I think that it lines up with what I have in mind at the moment…

For example, my thought at the moment is to represent eyes via simple black forms: no sclera, no irises, no real structure--just a curve or two and a circle, all in black against the colour of the skin. (I'm not yet sure of what to do then for darker skin-tones, but we'll see.)

And indeed, one of the few objects that I am happy with has stark, hard painted “shadows”, large regions that are uniform save for some broad variations in colour, and some soft shading.

JoeJ said:
… Probably not the 'technical level' you expected to hear. ; )

Hahah, indeed not--but it was an interesting approach to read, and did make some solid points, I feel! ^_^

JoeJ said:
I meant a global setting, not individually per texture. Just to have everything a bit sharper.

Ah, I see. When you said “manual” I took that to refer to creating one's own mip-maps directly in the texture, instead of relying on

Now that you mention it, I could mess with the thresholds that the engine uses for mip-mapping. I recall doing that in a previous (very different) project, and while it didn't work out there, it might here.

JoeJ said:
Though, not sure when this is actually a win. Personally i prefer smooth over sharp images, but many people love crisp and gritty stuff.

It might be worth investigating. Smooth textures are nice, but at this point we're less in “smooth” and more in “muddy”…

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Thaumaturge said:
When you said “manual” I took that to refer to creating one's own mip-maps directly in the texture

No, i meant to change shaders so higher resolution mip maps are preferred: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/textureLod.xhtml

Usually the lod parameter is calculated automatically, but by calculating yourself you can make textures sharper or blurrier. Changing the default ideal value just a bit might help, but i never used this myself yet.
First you need to figure out how to calculate the default value. I expect some formula like this: float lod = log2(texelToPixelRatio)
Then you can add a constant of -0.5 to increase sharpness: float myLod = log2(texelToPixelRatio) - 0.5
The price is aliasing due to under sampling. But if your textures are mostly smooth gradients / blotches of solid color, plus some black lines for example, there would be no problem in practice because high frequencies in the texture are sparse.

I guess this gives better results than applying some sharpening to mip map levels, because the 'damage' of a sharpening process is permanent if we do so. But not sure - depends and worth a try.

Thaumaturge said:
It might be worth investigating. Smooth textures are nice, but at this point we're less in “smooth” and more in “muddy”…

Oh ok.
A smooth example would be the game Inside, which also is pretty orthographic iirc.
Ortho / 2D projection surely helps a bit with TAA, and they had extremely high quality AA in that game. They also used some area lights to achieve smooth lighting as well.

There is the argument of having a smooth and well sampled initial image and then apply sharpening to that, gives better quality than trying to compositing a image form sharp content.
That's usually true, and not a question personal preference.

So i leave the link to the best TAA resource i've found here: https://www.elopezr.com/temporal-aa-and-the-quest-for-the-holy-trail/


In case you decide to dig into that rabbit hole ; )

Advertisement

Well, I tried explicitly setting the mip-mapping level in my shaders (via use of GLSL's “textureLod” method), and… you are quite right! What a difference it makes!

In short, the textures applied to various objects in my game are considerably sharper now! (There are even things that I was previously happy with that now look so much clearer!) ^_^

There are still some stylistic matters to take care of, at least some of which I think have been mentioned in the thread above. One thing that I'm finding is that sharp changes in colour produce some unsightly aliasing, at least at my current monitor resolution, so I daresay that I'm going to want to try to reduce such. But I feel that I have a decent idea of how to proceed from here. ^_^

As to temporal antialiasing… If it comes to be called for, I might look into that--but I'd rather not for now! ^^;

Thank you for all of your help! ^_^

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

Thaumaturge said:
Well, I tried explicitly setting the mip-mapping level in my shaders (via use of GLSL's “textureLod” method), and… you are quite right! What a difference it makes!

Ha, nice to hear. I really was just guessing ; )

JoeJ said:
Ha, nice to hear. I really was just guessing ; )

Sometimes a good guess is a useful thing. ^_^

MWAHAHAHAHAHAHA!!!

My Twitter Account: @EbornIan

This topic is closed to new replies.

Advertisement