|
From: Stuart B. <stu...@gm...> - 2023-12-28 10:15:26
|
On Sat, Dec 23, 2023 at 6:43 PM Richard Harrison wrote: > > This looks just it would just require tieing > SGSceneFeatures::instance()->setMaxTextureSize() > ... > the resizing code in simgear/scene/model/ModelRegistry.cxx lines 428-450 > do its stuff. > > Richard - any reason this wouldn't Just Work? > > that should work fine; however do bear in mind the original purpose of the > max texture size is to try to make sure that the textures will not be too > big for the GPU. > I'm thinkin that we'd use the minimum of the texture size being reported by the graphics card (osg::GLExtensions->maxTextureSize), and whatever the user has selected. I noticed that you have a floor of 2048 in the cache code, with the following comment: // heuristically less than 2048 is more likely to be a badly reported size rather than // something that is valid so we'll have a minimum size of 2048. So I'll use a calculation like this: min(/sim/rendering/maximum-texture-size-px, max(osg::GLExtensions->maxTextureSize, 2048)) which should cover all bases. Maybe encode something into the filename to trigger this and/or provide a > hint about the resizing that should be applied. > I think this is a sufficiently useful function that we should just apply it across the board. For example, it would be applicable for aircraft models with high resolution textures as well. OTOH, perhaps the osg::GLExtensions->maxTextureSize value that limits texture size anyway is good enough? I.e. is there a use-case where a user would want to limit the maximum texture size _below_ the graphics cards reported limit? I think there is, as users choose to trade-off texture size for framerate if their GPU is paging to main memory. > However do remember that once created the cached image will not be > recreated > Yes. To make this usable it probably needs something in the launcher , along with an option to delete the DDS cache. There is a broader issue here: We need to have a think about how we present rendering quality controls to the user as there are just far too many property controls for WS3.0 rendering in particular. -Stuart |