Further mips discussion

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Further mips discussion

Post by JackGriffin »

nogardilaref wrote: Texture for mesh: mipmaps should always be off, unless they're over 256x256, at which case most renderers will just crash (not all of them though).
(quote from another discussion)

Can you elaborate on this? It's not been my experience and I've imported some pretty large textures for meshes (lots of 1024 square ones) without obvious problems. If I did it wrong and created issues for the client then I'd like to know so I don't do that again. Also why not generate mips on these mesh textures? Does the engine handle this itself when drawing the mesh at distance?
So long, and thanks for all the fish
SC]-[WARTZ_{HoF}
Adept
Posts: 426
Joined: Tue Feb 21, 2012 7:29 pm

Re: Further mips discussion

Post by SC]-[WARTZ_{HoF} »

This has already been covered in this old post.

viewtopic.php?f=57&t=5210#p56841
Image
Image
Image
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Further mips discussion

Post by nogardilaref »

Well, they have no "problems" per say being used in meshes with mipmaps, they do not crash or anything, on the contrary, they're the safest bet crash-wise.

However, the real issue is that mipmaps cause a small quality drop when used in a mesh, they get a little bit more blurry than what they should.
In some textures this won't be noticeable, in others it becomes more obvious, such as textures with hard edges, small details and some contrast.

Furthermore, mipmaps are meant mostly for repeating textures. It's not much about a performance boost, it's actually more to avoid a visual problem that occurs in repeating patterns when seen from far away, they get very "noisy" and "wavey" (aliasing) as the texture has to be entirely rendered with fewer and fewer pixels, and as you move you would start to see the texture waving around.
So by mipmapping they get more blurry on purpose, so the level of detail of the texture is always perceived to be the same independent from the distance, and it eliminates the aliasing.

This is also why screenshot textures should never ever be mipmapped: they are rendered directly on the screen (so no need for mipmaps), and they do also get a quality drop iirc.

Therefore, by concept alone, meshes are generally not meant to have mipmapped textures. In meshes you generally have a specially tailored and UV mapped texture for the mesh itself, and it's non-repeating, so you never have aliasing problems.
Exceptions to this rule were mostly introduced by UT2004 itself: static meshes (which replace brushes to an extent), and they use seamless textures sometimes.
Also, if you have a mesh sheet with a grid for example, it would also be best to mipmap it.

But in UT there's a small issue with non-mipmapped textures: some of the most used renderers, even nowadays, do not support non-mipmapped textures over 256x256.
So if you have a normal mesh and a 512x512 texture for it, it has to forcefully be mipmapped, or it will crash the renderer due to the lack of sufficient mipmaps.
I believe this was fixed in more recent renderers (OpenGL, D3D10+ I think), but I am not 100% sure, but I do remember a couple of mods from the Unreal community which relied on a renderer able to render non-mipmapped 1024x1024 textures.
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: Further mips discussion

Post by Red_Fist »

I only thought they blend pixilation, and work as you are close or far away.

I thought meshes aren't supposed to have them, but I have no clue.

But the settings when you want to make a screenshot in UT2004 they have that "world texture" or one of the other types or whatever the others are.
all confusing to me.

But you don't use one selection for meshes, and the other for walls, I would have to look to see what they were.
Binary Space Partitioning
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Further mips discussion

Post by nogardilaref »

Red_Fist wrote:But the settings when you want to make a screenshot in UT2004 they have that "world texture" or one of the other types or whatever the others are.
all confusing to me.
If I am not mistaken, that's probably equivalent to LODSET_World from UT (there's LODSET_World, LODSET_Skin and LODSET_None iirc).
These are just to point out to the engine which quality settings effect those textures.

If it's for BSP: LODSET_World.
If it's for meshes: LODSET_Skin.
If it's for things rendered in the canvas (screenshots, menus, icons, etc): LODSET_None (-> do not apply any quality setting at all, so it's always with full quality).

In the case of UT2004, static meshes are effectively something between normal meshes and BSP in their categorization: they are meshes, but are used like BSP models, so probably they should always have world textures indeed.
Red_Fist
Godlike
Posts: 2163
Joined: Sun Oct 05, 2008 3:31 am

Re: Further mips discussion

Post by Red_Fist »

In one map I am working on, if you zoom with the sniper the skybox looks pixelated so I was thinking it needs to be redone with mips ?

It is a stock skybox I stole from a stock map too. the low quality one I suspect. But I never see that on other maps.
Binary Space Partitioning
nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: Further mips discussion

Post by nogardilaref »

Most skyboxes in UT are very low resolution for the surface they occupy. But then again, it was made for '99 hardware, so it's expected.
They look pixelated for a different reason however, it has nothing to do with mipmapping at all: when you create a skybox, the BSP surfaces you set the skybox texture to must have "No Smooth" to true, generally speaking.

This is because, for skyboxes which are composed by 4 textures which connect to each other, if they are "smoothly" rendered, you will see seams at the edges of the skybox itself, and it completely breaks the illusion and immersion. However, if not, they are smoothly rendered and you cannot tell where each texture begins and ends, but if they're do not have an enough high resolution, they will look pixelated.

My advice: do it like it's done in modern games, use meshes, BSP, whatever, to build an actual scene as being a skybox, and not only you don't have to worry about pixelated stuff anymore, it will resemble more closely the visuals of the rest of the map.
In UT2004 you have maps which use dome meshes instead with a single texture with moving clouds and all, it works pretty well.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Further mips discussion

Post by sektor2111 »

To be honest I'm not sure if you guys did some basic checks. I was interested to see texture properties from some World related things and Skins related usage. This means Troopers are crapped but I don't see them crashing anything...
[attachment=0]All_Of_Them.PNG[/attachment]
Seriously troopers have the same skins as Indus2 by example. It's LODset_Word and MipMult=1.000000, I see these properties used into a skin and a wall.
If your display is crashing probably some noob was doing a texture with a NON-standard resolution and... combined with some smarty settings even Editor can go down.
I see 2 maps by example having readable Sreenshot... IN EDITOR. In game's menu is black like it doesn't exist yeah, 16 bit, lol... but mapper was too busy for checking what was doing... I'm not gonna give any name - you'll see yourself what I mean.

My two cents:
I think I can use mips everywhere. Why ? Because I did not see a single issue if textures are properly imported without pushing limits. Let render to smooth them properly.
Attachments
All_Of_Them.PNG
Post Reply