Optimization Suggestion

Discussion in 'General Discussion' started by taufikp, Mar 11, 2012.

  1. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    DISCLAIMER
    My suggestion is solely based on what I see in the simulation, and it actually made me writing this. Maybe the graphic engine is already smart enough to ignore these issues or automatically make adjustment (like LOD), and hence wouldn't have any impact on performance. If so, consider this as my published rant :p and feel free to close this post.


    Remove Reflections and Tires from Cockpit View's 3D Mesh
    With Megane's cockpit mesh, the car body exterior has reflective surface and even the rear tires are still there. Since reflection would cost some FPS, removing them from car body exterior might improve the FPS. Also, removing rear tire mesh from cockpit mesh might improve FPS further. Why they were not removed from cockpit mesh by the way? :confused:

    Remove Some Reflections On 1960s Formula Vehicles
    While playing with free cam (Ctrl+U) activated, I noticed that the inner-side of the engine cover in F3 cars is reflective. Imagine having 20 cars in field, each has reflection on the side that will never be looked at directly most of the time by the player. Also some suspension legs are reflective.
     
  2. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    AFAIK rF graphics engine doesn't render objects and textures(?) which are not visible. Memory loss is so small when loading few tires, that this shouldn't make much difference. I've learned that one of the "features" of rF is that main car body exterior is visible in cockpit view, so disabling reflection from that would disable it also from all the other views.

    I would like to see screenshot about the issue, sounds like that there is two-sided texture in use but I am not sure. Again I believe that this engine doesn't render reflections that cannot be seen. I find it very hard to believe that this would not be the case, because that would mean that engine would be very badly optimized.

    In general, you can disable environmental reflections from options and maybe gain some FPS.
     
  3. MaXyM

    MaXyM Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,774
    Likes Received:
    29
    It's because it must be the same material since we want to make it skinned. Of course we can prepare wcextra materials, but would it be a real gain to have 2 materials instead of one? Additionally wcextra material needs separate texture.

    More over I don't see a sense of disabling reflectance properties from cocpit view. We often can see parts of body, like bonnet sitting in a car. It should stay reflective as in real.

    best regards
     
  4. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    This video shows some issues with current rFactor 2 Beta (Build 60) that I have written above. Solving this issue may improve things, or maybe not. Depends on how efficient is the graphic engine.

    The Megane video shows how the 3d model from Cockpit View is reflective and also has rear tires. The F3 video shows that the inner side of F3 engine cover is reflective.

    So, I'm thinking about these suggestions:
    • Removing reflections from cockpit model parts that are not directly visible from driver's normal point and view.
    • Removing reflections from inner side of parts such as engine cover in F3 model.
    • Removing rear tires from cockpit view 3d model could improve loading time and use less memory.
    I'm also wondering if this issue is actually related more to 3d modeling optimization instead of graphic engine optimization.

    Anyway, I'm only guessing here. I don't exactly know how the graphic engine do the entire rendering process. However, since rFactor 2 is still in beta, and obviously still open to suggestions, make changes, and do more optimization, hopefully this could help ISI to make rFactor 2 a much better product.

    Just my two cents. :)

     
  5. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Your suggestions would be good if games would work based on "brute force" approach (render everything there is).
    Games use frustum culling which means only what's in front of camera and in view is rendered. Other objects can be there but they do not affect performance because they're skipped by rendering engine as long as they're not in view.

    Only when yo move your camera out of the cockpit they will start to affect performance, because now you're looking at them.
     
  6. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    Yes that is true, especially for cockpit view, frustum culling really does help. However, I'm quite sure that rear tires (and rear wing maybe) in Megane's cockpit view really need to be removed. They're wasting precious video memory and adding load time, since all Meganes loaded to the track will have this "problem". Try to move from car to car in free cam mode to inspect them.

    For inner side reflection, this need a fix. Reflection will be rendered whenever we have another car in front of (and beside) our car/view. If it was only one car, might not cause big problem, but if there were more cars ahead, could cause FPS drop.

    Reflections (on car body and on the road during wet race) to me are not a mere gimmick, they really enhance the immersion, and I really like them so much that I don't want to turn them off. :p

    But, hey, this is BETA and ISI expect us to give them constructive inputs, right? :)

    I hope the video could help ISI to optimize the car's 3d models, especially for the soon-to-be-released stuff. ;)
     
  7. Foxtrot

    Foxtrot Registered

    Joined:
    Nov 2, 2011
    Messages:
    224
    Likes Received:
    33
    They are visable for a reason. Sooner or later they will re-enable seeing your carbody, rear wing and tires in mirrors like previous ISI titles.

    The option is still in the plr file, the feature has just been disabled in the beta.
     
  8. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    Well, as far as I know Megane is not an open wheel vehicle, and judging from the rear fender, rear tires will not (and should not) be visible in mirrors. I have no problem with open wheel's cockpit view model having rear tires as well, because indeed rear tires of open wheel vehicles are supposed to be visible in the mirrors like what you have said.
     
    Last edited by a moderator: Mar 16, 2012
  9. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    And I'm quite sure you're wrong :)

    These parts need to be loaded anyway, because you can see rear wings and tyres of other cars while you're driving, so they must be loaded. You can also switch to external view of your car at any time, so yours need to be loaded, too.

    Even if you stick to cockpit view - it's only your car that you see from cockpit, and the moment you press Esc and return to garage you see an instant replay of your car - with external view of course.

    Looks like you didn't give it enough thought :)
     
  10. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    It seems that a slight misunderstanding is happening here because I was using the wrong word, "view" :) So I will describe what I meant a little bit in detail.

    Referring to what I had learned and done in modeling a 3D vehicle for F1C and rFactor, and also based from ISI's 3DMax vehicle sample for rFactor, there are two 3D models used: one for external view (external model), and one for cockpit view (cockpit model). Usually the cockpit model is a bit bigger/wider than the external model. The cockpit model also does not include rear tire and front tire. Of course for an open wheel vehicle you need to have all tires (and wings) since they will be visible from driver's "eye".

    EDIT: Actually there are three 3D models used by gMotor. The third model is invisible and used to detect collision (I used to call it 'crash-test-dummy' model) and usually having roughly the same dimension as the external 3D model, but with much, much, less detail/polygons.

    When viewing from driver's "eye", what we see is:
    - cockpit 3D model
    - external 3D model to show other player's vehicle

    When we switched to external view (on-board cams, track side cams), gMotor will show external 3D model only.

    The video above was made with driver's eye cam active, then I used free cam (Ctrl+U) and just floating outside the vehicle in Megane's part. For F3 part, I used vehicle on-board cam, not driver's "eye" cam, then move it so I'm "sitting" inside the engine block to look at the engine cover above me. F3's cockpit 3D model does not include engine and its cover, only rear frame chassis.

    Hopefully this would clarify the confusion I created :)
     
  11. K Szczech

    K Szczech Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,720
    Likes Received:
    45
    Yeah, but this is where we get to the point I mentioned before.
    When you sit in cockpit, frustum culling will skip rear tyres and wing - no performance gain by removing them from things displayed in cockpit view.

    And they need to be loaded anyway - the same .GMT file is used in external view so it's needed - and it's not like it's loaded twice by being also enlisted among things visible in cockpit view :)

    Yes, we have 2 models, but they use the same GMT files (in case of rear wing and tyres that is).
     
  12. Johannes Rojola

    Johannes Rojola Registered

    Joined:
    Sep 8, 2011
    Messages:
    1,038
    Likes Received:
    38
    Yeah this is not valid with rF2 anymore. Same car main body model is used for exterior views and cockpit view. I guess you could override this but I haven't bothered to find out, since like said, culling prevents any areas being rendered which are not in view. Actual meshes (if reasonable polycounts) consumes very little memory so it doesn't make much difference performance wise.
     
  13. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    Ah I see. So rF2 uses the same model for cockpit and external view. And we are now controlling the vehicle via SCN/GEN file only? Since there is no cockpit 3d model anymore.
     
    Last edited by a moderator: Mar 17, 2012
  14. Foxtrot

    Foxtrot Registered

    Joined:
    Nov 2, 2011
    Messages:
    224
    Likes Received:
    33
    There's still somewhat of a cockpit. Higher detail interior parts shouldnt be rendered on a car you arent in. But yea the carbody is now included in cockpit view by default, even when it isnt included in your genfiles cockpit instance.
    Thought it was pretty funny the first time i drove an rf1 car in rf2 having multiple doorframes :p
     
  15. taufikp

    taufikp Registered

    Joined:
    Nov 14, 2010
    Messages:
    609
    Likes Received:
    16
    Ahh I see... it's more clearer to me now :D

    Thank you all. So my experienced with rFactor1 modding seems to be rather obsolete now.

    However, being an old school programmer, I believe some optimization on the 3d models still can be done. The power combo of modern CPU, GPU, and RAM (system and video) has made us a little bit on the lazy side when it comes to optimization, I think. :D
     
  16. Foxtrot

    Foxtrot Registered

    Joined:
    Nov 2, 2011
    Messages:
    224
    Likes Received:
    33
    lol
    No definitely not obsolete, they've just thrown a couple curveballs :p
     

Share This Page