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

 

Results 1 to 12 of 12
  1. View Forum Posts #1 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is 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. Visit Homepage View Forum Posts #2 Reply With Quote
    Ritter MaGoth's Avatar
    Join Date
    May 2007
    Location
    Russland (Samara)
    Posts
    1,340
     
    MaGoth is 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!=-
    Last edited by MaGoth; 09.11.2019 at 00:20.

  3. View Forum Posts #3 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is 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. View Forum Posts #4 Reply With Quote
    Local Hero Mark56's Avatar
    Join Date
    Sep 2010
    Posts
    243
     
    Mark56 is 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. View Forum Posts #5 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is 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. View Forum Posts #6 Reply With Quote
    Local Hero Mark56's Avatar
    Join Date
    Sep 2010
    Posts
    243
     
    Mark56 is 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
    Last edited by Mark56; 12.11.2019 at 10:42.

  7. View Forum Posts #7 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is 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=abee03248f2e304def679b3fd6a85627&attachmentid=48514&d=1573734469&thumb=1][Bild: attachment.php?s=abee03248f2e304def679b3fd6a85627&attachmentid=48515&d=1573734480&thumb=1]

  8. View Forum Posts #8 Reply With Quote
    Local Hero Mark56's Avatar
    Join Date
    Sep 2010
    Posts
    243
     
    Mark56 is 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. View Forum Posts #9 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is offline
    Ok, I'll try it out! Thank you

  10. View Forum Posts #10 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is 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. View Forum Posts #11 Reply With Quote
    General lali's Avatar
    Join Date
    Feb 2016
    Posts
    3,577
     
    lali is offline
    Have you tried to type "maitai" with activated character screen? Or just 42?

  12. View Forum Posts #12 Reply With Quote
    Veteran
    Join Date
    Jan 2012
    Posts
    680
     
    Frank-95 is offline
    42 did the trick, I hadn't thought of it!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
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