Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Ergebnis 1 bis 12 von 12
  1. Beiträge anzeigen #1 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline

    Levelmesh optimization

    Hello.

    I've decided to start an optimization process of the G2 levelmesh using GHOSTOCCLUDER and SUN_BLOCKER_2000 polygons. I have some questions, though, of which I hope to find answers here

    1) Are those polygons to be double sided? Is it important, or are they just to be midway between the player position and the vobs to hide?
    2) Must they be used both it order to block both vobs both sun rendering? If yes, can they have the same position (e.g. like portals)
    3) Does SUN_BLOCKER_2000 have to called like this, or SUN_BLOCKER is enough?
    4) In case I have a generic cave with portals P:_XXX and P:XXX_, does the renderer know that the cave is indoor? If yes, does it perform sun and vobs optimization by itself?

    Thank you very much

  2. Homepage besuchen Beiträge anzeigen #2 Zitieren
    Ritter Avatar von MaGoth
    Registriert seit
    May 2007
    Ort
    Russland (Samara)
    Beiträge
    1.407
     
    MaGoth ist offline
    Hi, Frank-95
    The game uses 4 types of portals:
    p: - (this is the standard portal of the world type - outdoor, location of the island / city of Khorinis);
    pi: - (this is a standard portal of the world of the type - indoor, any location mine loaded in the game);
    pn: - (the same as the p: portal, only the texture lays on it with the alpha channel, since it disappears for a long time, this is a slow type of portal);
    ghostoccluder - this is another kind of portal that serves to reflect light, so that everything that is behind it, when a camera is seen, is not drawn in its direction, which removes the load from the hardware. In order not to load the processor, the territory is divided by similar reflectors (in a gamedev, they are sometimes called mirrors). Simple material is used for ghostoccluder, you just need to give a name to the ghostoccluder texture and that’s it.

    As for the portals as a whole, the usual two-sided polygon with stitched vertices is used there.

    Also, there is also a sun_block light blocker - it is something like artificial separation of the interior without loading. In the game, its use can be seen around the temple of Adanos. In G1, it does not seem to be used.


    MfG MaGoth,
    |: WOG.de :|: WOG.en :|: WOG.ru :|: WOG.ro :|||: MAGIC-Team :|
    [Bild: 106462_941c3dcc88ff9e9b5597d9f24d9aea88.jpg]
    |: WOR.de :|: WOR.en :|: WOR.ru :|: WOR.ro :|||: Piranha-Bytes :|
    -=GOTHIC UND DIE FREUNDSCHAFT FÜR ALLE ZEITEN!=-
    Geändert von MaGoth (08.11.2019 um 22:20 Uhr)

  3. Beiträge anzeigen #3 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Thank you for your answer, even though I've never come across PI and PN portals.

    So could it be useful to use GHOSTOCCLUDER and SUN_BLOCKER_2000 to hide for example, the monastery underground, to improve performance?

  4. Beiträge anzeigen #4 Zitieren
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    I believe PN portals are for forest "walls" in Gothic 1, where in the distance you see texture instead of tree vobs inside.

    GHOSTOCCLUDER is mostly used inside mountains. As occlusion culling renders only vobs in front of the camera, GHOSTOCCLUDER helps even more, because you cannot actually see anything behind mountain. So this is very helpful. I used mountain as example, because it's the most common scenario. Also, if there is deep valley. User won't see outside and vice versa. So basically if threre is large visual "barrier" in your world mesh. You should place ghostoccluder inside.

    SUN_BLOCKER_2000 is rather "hack", in a sense. Since polygons are one sided, if "interior" is not covered by polygons facing up, the light still comes through. As example, some caves/dungeons go "beyond" world surface. In g1 this is not used. because all caves are covered by mountains. You can look at old fortress (quest with Lester) where actual interior of the fortress is covered by mountains from all sides. Mountain mesh is stretched all the way, so that no matter where sun is. Light won't come through.

  5. Beiträge anzeigen #5 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Thank you!

    So sun_blocker is not hardcoded, it's just a material for polygons used to hide what there is below them from sun rays, am I right?

    As regards GHOSTOCCLUDER, did you ever use it to optimize a dungeon? Like monastery underground, xardas tower, and other big caves around khorinis?

  6. Beiträge anzeigen #6 Zitieren
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    So sun_blocker is not hardcoded, it's just a material for polygons used to hide what there is below them from sun rays, am I right?
    Correct.

    As regards GHOSTOCCLUDER, did you ever use it to optimize a dungeon? Like monastery underground, xardas tower, and other big caves around khorinis?
    Well If portals are used properly - by that I mean large rooms are separated by portals as well, then there should be no need. The moment you enter indoor "zone", given that you cannot see portal, everything except that particular room is excluded from rendering. You can test it yourself.

    1. Go into some house.
    2. Turn your camera at the door so you can see outside.
    3. Open console and enter command [1]:
    Code:
    zrmode wire
    4. Rendering in wires allows you to see all that is render "rendering" even behind the walls - if your camera points at door, you should see wires of the outdoor world and vobs in front of camera.
    5. Turn your camera slowly away from door/portal
    6. The moment portal is not in the camera viewport, outdoor mesh disappears. Thanks to the portal functionality.

    So there is no need to add ghost-occluder in Dungeons, if portals used correctly.
    If you go to adanos temple, you can see each big room has portal and you will see directly, that the only rendered rooms are the two adjacent ones. Not the whole dungeon.

    But again, if you have big cave - which has open roof like this:
    Spoiler:(zum lesen bitte Text markieren)

    Its better to put ghost occluder around it, because there is no separation from outer world and engine could be processing outside world that is not visible.
    Again easiest way to test this is with rendering mode set to wire. If you see whole world being rendered and inside cave/dungeon. There is portal missing/broken/ghostoccluder needed.

    But, if you have large city, with lots of polygons, You can/should place ghostoccluder inside walls and large buildings so that while inside, only visible portion of the city is being processed. Such scenario would be upper part of the Khorinis, where you cannot see lower part of city anyway, so that putting ghost occluders inside walls is very reasonable decision. Best way is to load original levelmeshes and see where developers placed them[2]screenshot here.


    [1]marvin codes

    [2]polish tips about level meshes
    [3]more tips about gothic and 3D
    Geändert von Mark56 (12.11.2019 um 08:42 Uhr)

  7. Beiträge anzeigen #7 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Thank you!

    But the example adanos' temple doesn't add up. You said that if portals are placed correctly the game won't render what is behind them unless you directly face them, so only the room will be rendered. But in the level mesh you can clearly see that there are ghostoccluder and sun rays polygons (first image attached). This doesn't seem logical since the dungeon is "closed above", blocking thus sun rays and any other form of rendering (second image).

    Does that make sense?

    [Bild: attachment.php?s=14046ac80c350d641a49a4bafbe8b967&attachmentid=48514&d=1573734469&thumb=1][Bild: attachment.php?s=14046ac80c350d641a49a4bafbe8b967&attachmentid=48515&d=1573734480&thumb=1]

  8. Beiträge anzeigen #8 Zitieren
    Local Hero Avatar von Mark56
    Registriert seit
    Sep 2010
    Beiträge
    254
     
    Mark56 ist offline
    First and foremost, I am just giving you theory of how they were intended to work.

    There is still possibility that they are not so well implemented, and they were indeed necessasary in Adanos temple, or that maybe Adanos temple was meant to be part of the outdoor world and not separated. But it was split later on, so they just left it in. Maybe it's there "just to be sure"

    I tested it long time ago. Well, I still recommend you, to first try that wire rendering inside some house in the city. That should give you better hint on how it behaves, and if it actually works as intended.

  9. Beiträge anzeigen #9 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Ok, I'll try it out! Thank you

  10. Beiträge anzeigen #10 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    Hi, sorry again.

    Could you tell me how to cancel the wire rendering and revert to normal visualization? Because I noted that the view changes also the console and the manu and I wasn't able to exit the game properly or load another save.

    Thank you

  11. Beiträge anzeigen #11 Zitieren
    Hero Avatar von lali
    Registriert seit
    Feb 2016
    Beiträge
    5.473
     
    lali ist offline
    Have you tried to type "maitai" with activated character screen? Or just 42?
    Phoenix Dev | Website | Discord

  12. Beiträge anzeigen #12 Zitieren
    Veteran
    Registriert seit
    Jan 2012
    Beiträge
    681
     
    Frank-95 ist offline
    42 did the trick, I hadn't thought of it!

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide