1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Wet Runways and Aprons in P3D

Discussion in 'Prepar3D' started by Gianni, 19 Sep 2016.

  1. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    Hi all,

    I am having a question about the "wet surfaces". Never tried it before so the question might be kind of very generic. And as far as I see it is also valid for FSX.

    I made a material according to the SDK and applied it to the ground polygons and it works fine so far. The only problem which I could not sort out up to now is that I am not able to control the appearance of the "wet polygons". They are visible also in dry conditions.

    The settings in the material editor should in my understanding control the behaviour according to precipitation but with the values (see attachment) I do not see any effect.

    What did I miss?
     

    Attached Files:

  2. dave hoeffgen

    dave hoeffgen Resource contributor

    Joined:
    16 Sep 2014
    Messages:
    1,104
    Country:
    germany
    How's the rest of the material?

    The precipitation only affects the reflection. If the material isn't reflective nothing changes.
     
  3. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    Thank you for the quick response. Here is the rest of the material setting (copied from MCX): mat_prec_1.JPG mat_prec_2.JPG
     
  4. dave hoeffgen

    dave hoeffgen Resource contributor

    Joined:
    16 Sep 2014
    Messages:
    1,104
    Country:
    germany
    Is it invisible all the time? The No zwrite thing on top of other meshes usually makes things invisible
     
  5. robystar

    robystar

    Joined:
    4 Oct 2006
    Messages:
    4,399
    You do not have a bump map nor an environment texture.
     
  6. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    I was thinking that when I tick the standard environment texture this will be used. However I will give it a try.
     
  7. robystar

    robystar

    Joined:
    4 Oct 2006
    Messages:
    4,399
    Yup, but you do need a bump/normal map and blend the environment with either the inverse diffuse alpha or the specular alpha (that you do not have). Moreover, I have not the faintest what your precip.dds is like but it should be your regular top layer texture.
     
  8. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    Hi Roby,

    Hm, let me explain what I did:

    • I was modelling the different "layers" with GMAX and applied the FSX-materials (edit: the materials as described both in the FSX and the P3D SDK - anyway I am trying to develop for P3D 3.3.5).
    • One of these layers shall contain the precipitation effects. The file "precip.dds" is just light-blue with an alpha channel; the newly assigned file "precip_nm.dds" is the assigned bump-map (made with the NVIDIA plug in). The concept was to define this material with the highest priority for the visibility together with the other materials in the object (the entire ground of the airport)
    • I was planning to use the Polygon-Wizzard in MCX and to use negative z-bias values for the different layers. hence the precipitation layer (material) should have the lowest z-bias (in the current situation this would be the z-bias value of -24). The intire model shall looke like this (all polys have the same reference point):
    • zbias -4: base materials
    • zbias -8: overlay runway
    • zbias -12: markings
    • zbias -16: overlay vegetation
    • zbias -20: overlay asphalt
    • zbias -24: precipitation materials
    Everything with the exemption of the precipitation layer works. But if I include the layer -24 within the model I encounter the following problems:

    Edited: The reflective materials are visible at any weather condition. No offset is realized (to be honest I do not know the value range for the offset, but whatever value I use it has no effect and does not change anything).

    forum_01.JPG forum_02.JPG
     
    Last edited: 21 Sep 2016
  9. robystar

    robystar

    Joined:
    4 Oct 2006
    Messages:
    4,399
    Well, as far as I know, the top layer should be made reflective and not your precip.dds.
    You have then to either use the gobal environment map as reflection or make your own cubemap. And then blend the environment with the inverse diffuse alpha (in your case because you do not have a specular texture and as long as your top asphalt layer has some alpha channel).
     
  10. dave hoeffgen

    dave hoeffgen Resource contributor

    Joined:
    16 Sep 2014
    Messages:
    1,104
    Country:
    germany
    FSX materials don't have Z-Bias.
    What MCX actually does is to move the geometry according to the value.

    Did you already use the Ground Polygon Wizard?
    It does not export FSX materials as it uses a legacy format to make the layering possible.
    Practically it means no conditional reflection, no bump or specular map.

    My approach:
    1. split the ground polygon into the reflective surface and the "rest"
    2. export the "rest" using the ground polygon wizard. set a higher layer for stuff that should be on top.
    3. Export the reflective surface using the normal exporter with your material set and the exact same coordinates. Make sure you corrected the object according to the curved earth.
     
  11. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    Sorry, I do not get your point. Maybe I am totally confused now. o_O
    • The Top-Layer in my understanding is the material which I want to make reflective (and it is reflective also in P3D). In the screenshot is has the lowest zbias value and hence is drawn with the highest priority.
    • For the sentence: "And then blend the environment with the inverse diffuse alpha (in your case because you do not have a specular texture and as long as your top asphalt layer has some alpha channel)" - could you perhaps tell which values in the screenshot would have to be amended in which way?
    Thank you for your help anyway!
     
  12. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    ehm, but this is exactly what the SDK says: the negative z-bias values are working for the sorting order and they are also visible in the layer overview when I use the ground polygon wizard (if the imported model was saved as "p3d-model"). I tried this approach and at least the sorting order works fine in P3D). The problem is the reflection stuff for rain and environment reflection during wet weather conditions.

    Seems that I am running in a wrong direction. Would you mind to write me a PN with your mobile number (I would call you then)?
     
  13. robystar

    robystar

    Joined:
    4 Oct 2006
    Messages:
    4,399
    We are talking about P3D, Dave (P3Dv2.5, 3 and later).
    Maybe your approach is OK, Gianni, I do not know. I can only tell you how I managed to do it.
    Make sure you first have one P3D compiled mdl (if necessary, merge them into one). Then add the FSX material settings to that one, compile again and then use the GPW to make a bgl.
    As for the material settings, let us at first stay as simple as possible:
    Say your top layer is asphalt and semi-transparent and you want a wet surface effect on it, you need to:
    - set Z-alpha to True; (no shadow and no Z-write will be done automatically by the GPW)
    - Precipitation, take into account = True
    - blend environment by inverse diffuse alpha = True;
    - use global environment map as reflection = True and
    - use the bump map as you did.
    - adapt the reflection scale so that the reflection is to your liking.
    I am not sure if it is necessary for the destination blend to be inverse screen alpha or one. I have mine at the former.
     
  14. Gianni

    Gianni

    Joined:
    12 Jun 2005
    Messages:
    449
    Country:
    austria
    Thank you Roby, this is helpful! I am pretty sure that my layer beneath the reflective layer has no alpha channel. I will check this.

    For the rest of your proposed workflow I can confirm that I did it exactly like you are describing it.

    :stirthepo :wave:
     
  15. ckd76915

    ckd76915

    Joined:
    27 Feb 2008
    Messages:
    7
    Country:
    germany
    Hi Guys,
    i'm also working on that .... I'm now getting dynamic Reflections from the surrounding Area but not from buildings nor the planes ... any Idea what i am doing wrong ?
    Regards
    Chris
     

    Attached Files:

  16. robystar

    robystar

    Joined:
    4 Oct 2006
    Messages:
    4,399
    Of course I know what you are doing wrong:).
    In fact, you do not do anything wrong, you only do not do what you should do in case you want your buildings and airplanes to show up also.
    To achieve the latter, you would have to make your own environment map, i.e. a cube map and that is something kind of more complicated. I use the Cube Map Generator of ATI to make them.
    Edit: on second thought, well, I mean on having a look at your JPG, you may indeed be doing something wrong. I am just guessing but it could be the bump map (why else would the shine be so blueish?). Or else you have not blended your environment map with some other texture.
     
    Last edited: 30 Sep 2016
  17. Peter Hornfeck

    Peter Hornfeck

    Joined:
    23 Apr 2013
    Messages:
    86
    Country:
    germany

    This video explains how to make cube map, it is not difficult this way.
     

Share This Page