Distant objects

Everything about development and the OpenMW source code.
User avatar
wareya
Posts: 338
Joined: 09 May 2015, 13:07

Re: Distant objects

Post by wareya »

So, I think that even without island-wide distant statics, it would still be super useful for immersion to display statics an extra cell or two around what's loaded for gameplay. And that's not blocked by getting LODs working well.
User avatar
psi29a
Posts: 5355
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Distant objects

Post by psi29a »

jup, i think so too
User avatar
Ravenwing
Posts: 335
Joined: 02 Jan 2016, 02:51

Re: Distant objects

Post by Ravenwing »

wareya wrote: 13 Jun 2018, 21:59 So, I think that even without island-wide distant statics, it would still be super useful for immersion to display statics an extra cell or two around what's loaded for gameplay. And that's not blocked by getting LODs working well.
Yes please! We need a way to not activate scripts when loading further distances. It seems like this would be a logical first step for distant statics anyway.
akortunov wrote: 13 Jun 2018, 17:53 About osgUtil::Simplifier: it provides a quite good results (but not ideal). Here are screenshots with 50% detail.
Simplification takes a lot of time, so I am not sure if we will manage to do it on the fly.
Those honestly look about at bad as Morrowind meshes normally look to me, so at a distance they'd be fine. I've always been ok with something we have to run outside the game anyway, I don't think people would mind until we got a more efficient system. Any form of distant statics would be huge for popularity.
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Distant objects

Post by akortunov »

I also tried to use the osg::Image::scaleImage() to get low-quality textures, but for some reason it only works for TGA textures:

Code: Select all

Error Image::scaleImage() did not succeed : errorString = invalid enumerant. The rendering context may be invalid.

Code: Select all

osg::ref_ptr<osg::Image> image = result.getImage();

[read image from file]

if (image.valid())
{
    int w = image->s(), h = image->t(), nw, nh;
    int mts = 256;
    nw = std::min(image->computeNearestPowerOfTwo(w), mts);
    nh = std::min(image->computeNearestPowerOfTwo(h), mts * h / w);
    image->scaleImage(nw, nh, image->r());
}
What am I doing wrong?
Or we just do not need to downscale DDS textures because of mipmaps?
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Distant objects

Post by AnyOldName3 »

There's no point downscaling an image with mipmaps as you'll just end up with mipmaps.
User avatar
psi29a
Posts: 5355
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Distant objects

Post by psi29a »

DDS already has LOD, those are mipmaps.
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: Distant objects

Post by AnyOldName3 »

It would be nice if we had a BA2-like system for loading the low-quality mipmaps of a DDS file without the high-quality ones needing to be loaded, too.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Distant objects

Post by Chris »

akortunov wrote: 15 Jun 2018, 09:43 I also tried to use the osg::Image::scaleImage() to get low-quality textures, but for some reason it only works for TGA textures
DXT (what's usually in DDS) is a block-based compression scheme. You can't scale it without decompressing and recompressing the image, which would be both slow and lossy on top of the rescale. As others have said, we already have mipmaps, so what it should try to do is use a lower mipmap level as the highest (this can get compicated when you have a texture that is both close and far; ideally you would just use the same texture with the max mipmap level clamped on the distant object and not load a second copy).
User avatar
akortunov
Posts: 899
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Distant objects

Post by akortunov »

Also probably the Reducer feature from http://code.google.com/p/osgworks will give better results than osg::Simplifier.
Martinsen
Posts: 1
Joined: 18 Sep 2018, 10:08

Re: Distant objects

Post by Martinsen »

What's the difference between those two btw, Akortunov?
Post Reply