Git Product home page Git Product logo

Comments (10)

CuriousMike56 avatar CuriousMike56 commented on July 3, 2024

It appears App::GetCameraManager()->GetCamera()->setFarClipDistance(fogEnd / 0.8); culls far away objects.
This is latest master:
screenshot_2024-03-04_14-05-06_1
And here's with the above line removed:
screenshot_2024-03-04_14-05-26_1
Clouds are fully visible now, but notice the much higher triangle/batch count and subsequently lower FPS.
image

Also BTW, I think 5000 m isn't much for max far distance. And it's not really a key setting nowadays IMO.

Pretty sure 5000 is actually unlimited, on extremely large maps such as Grenoble the entire heightmap is visible:
screenshot_2024-03-01_14-24-59_1

from rigs-of-rods.

cryham avatar cryham commented on July 3, 2024

Okay. Well right now it's either fog or clouds, can't have both. So I think this should be fixed.
Can't have far flat plane clouds with near camera distance.
As for more batches, I think it'd be up to user or graphics presets to set this if it drops Fps.
Anyway 140 Fps sounds pretty high already, and over 2000 batches like way too high regardless.

from rigs-of-rods.

CuriousMike56 avatar CuriousMike56 commented on July 3, 2024

Yeah the FPS is only because I'm on a high end PC (13700k, 4070ti), the difference will be much more drastic on the average player's lower end CPU with integrated graphics. High batch count is another pain point in RoR, Petr is aiming to fix it with his TerrnBatcher project (#3030)

I'm sure there's a proper way to fix the clouds, maybe with a patch to Caelum sources?

from rigs-of-rods.

CuriousMike56 avatar CuriousMike56 commented on July 3, 2024

Looking at Caelum source, the cloud entity is named Caelum/FlatCloudLayer/Entity/ + random ID. Would it be possible to apply the culling to all objects except the cloud entity?

from rigs-of-rods.

cryham avatar cryham commented on July 3, 2024

I don't think it's possible. This is camera far plane, it works for all.

from rigs-of-rods.

ohlidalp avatar ohlidalp commented on July 3, 2024

@paroj Can you advise please? Intuitively I'd expect some option to override the near/far clipping per render queue or maybe even per entity.

from rigs-of-rods.

paroj avatar paroj commented on July 3, 2024

Intuitively I'd expect some option to override the near/far clipping per render queue or maybe even per entity.

yes, you can set the max rendering distance per entity:
https://ogrecave.github.io/ogre/api/latest/class_ogre_1_1_movable_object.html#afe1f2a1009e3f14f36e1bcc9b1b9557e

note that using the far plane for this was wrong all along, as not rendering the objects is merely a side effect. The main purpose of the far plane is controlling the depth precision. The visibility system in Ogre is the intended tool for this.

from rigs-of-rods.

cryham avatar cryham commented on July 3, 2024

I don't think we're on the same page, or maybe I don't get it, I didn't look much inside code.
Am I right here ?:

  • One cloud layer here is done with a plane, which is basically 2 big triangles.
  • All triangles are culled by HW on GPU (during rasterization?). From camera far parameters also?
  • Setting camera FarClipDistance, does change its frustum culling, which works well (on CPU) for many single entities,
    meshes with small triangles.
  • rendering distance per entity also does the same, disable or enable rendering basing of distance.
  • even if clouds had a plane with many triangles these would also get cut off and culled in HW

from rigs-of-rods.

paroj avatar paroj commented on July 3, 2024

all above statements are correct. you want different CPU culling distances for different objects (cloud/ terrain - the rest). FarClipDistance can only be set globally and influences HW and CPU culling. Therefore you need to use rendering distance.

All triangles are culled by HW on GPU (during rasterization?). From camera far parameters also?

yes, see:
https://paroj.github.io/gltut/Positioning/Tut04%20Perspective%20Projection.html#idp2563

from rigs-of-rods.

cryham avatar cryham commented on July 3, 2024

Okay.
So I think the solution is still like like wrote in 1st post. To have far visibility of clouds.
But also to have less trees, adding maybe own distance to Gui or some other way to have them visible less far.
From what I know trees etc are in paged-geom and controlled by track file in .tobj like so:
trees 0, 360, 1.30169, 1.57545, 1.0, 300, 1000, treeD-22desMed.mesh none Des17-NileCity-veget4.png
here 300, 1000, is distance1, distance2, so it should rather be controlled by user from Gui for all tracks rather than by each track itself.
I'd also BTW add a multiplier (for that 1.0 before or a new thing) for trees multiplier to reduce (or get more) trees by user, from Gui too. We have such multipliers for trees, grass and their distance in StuntRally since a long time.

from rigs-of-rods.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.