Page 1 of 2

real3d mipmaps

PostPosted: Thu Mar 23, 2017 10:42 am
by Ian
Well .. someone on youtube pointed this one out to me

Image

I had a quite look at the actual mipmap data

I removed the other textures so you can see it more clearly

Image

The textures actually get darker as they get smaller. So presumably they rolled their own mipmaps specifically to create this effect.

I guess we can support this. Currently I just let the hardware automatically create the entire mipmap chain (this is extremely fast).
But we could use the real3d mipmap data directly. Just in software we would need to create the mipmaps down to 1x1 pixels, as the real3d only seems to have 6 levels of mipmaps. Which for anything over 32 pixels is not enough.

Re: real3d mipmaps

PostPosted: Thu Mar 23, 2017 1:42 pm
by HarryTuttle
Eh eh :D

I knew someone would have notice that :) I confess that I choosed that image on purpose :oops:

That's the mipmap issue we were talking about some day ago.

Re: real3d mipmaps

PostPosted: Thu Mar 23, 2017 2:41 pm
by Ian
Haha :)
It was a very good catch. The real3d api is very high level, wasn't sure if exposed direct access to manipulate the mipmaps. I will try and add support for it. Just need some time. Still need to have a proper test of your specular code :)

Re: real3d mipmaps

PostPosted: Thu Mar 23, 2017 6:03 pm
by Ian
Well,
this is using the real3d mipmaps. Actually turned out easier than I thought.
Only had minimal testing.. but basically seems to work. Still using an-isotropic filtering, just the max level is clamped to 6, or technically 5, because the base level is 0.

Image

Re: real3d mipmaps

PostPosted: Fri Mar 24, 2017 4:15 am
by HarryTuttle
Excellent work! :)

We should also consider that in Model 3 they're probably altering texture LOD to display darker mips nearer. I vaguely remember to have seen something about texture LOD and mipmap clamping in the API headers, but I want to check again to be sure.

Re: real3d mipmaps

PostPosted: Fri Mar 24, 2017 4:36 am
by Ian
Yeah I noticed that. They seemed to heavily favour texture aliasing in instead of blurry mipmaps. But the general texture LOD seems to work quite differently to modern h/w.

Re: real3d mipmaps

PostPosted: Fri Mar 24, 2017 5:09 am
by HarryTuttle
That's the reason why, infact, I've put in <Texture.cpp>:
Code: Select all
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_LOD_BIAS, -2.3f);

As a very ugly hackish all-around solution to display much more aliased textures to imitate the real thing. However this gives incorrect results elsewhere.

Re: real3d mipmaps

PostPosted: Fri Mar 24, 2017 8:30 am
by Spindizzi
Hi,
Is it linked to the mimap texture change ?
svn 536 (left) vs svn 533 (right)
Image

edit :
2nd comparison
svn 533 (left) vs svn 536 (right) inverted from first, sorry
Image

Re: real3d mipmaps

PostPosted: Fri Mar 24, 2017 8:50 am
by Ian
yes .. damn it >_<
It's quite possible there are bugs because the mipmap code has never been used before

Re: real3d mipmaps

PostPosted: Thu Aug 03, 2017 10:20 am
by scd
hei ian and harry. what's end up with the mipmaps feature? is it still in progress?

[img]

http://imgur.com/a/aGRTi

[/img]