TUTORIAL: Porting an HDRI sky texture to BeamNG.drive

Discussion in 'Content Creation' started by Tsutarja495, Feb 17, 2023.

  1. Tsutarja495

    Tsutarja495
    Expand Collapse

    Joined:
    Mar 16, 2014
    Messages:
    820
    YOU WILL NEED:
    Adobe Photoshop + NVIDIA DDS Plugin
    An HDRI (download these at polyhaven or similar)
    BeamNG.drive (obviously)
    A text editor (Notepad++ preferred)
    Sky template: https://drive.google.com/file/d/1HRJPpqXlCtk_M71mzxo8AXCqsoUBSuVM/view?usp=share_link

    1. Download the template and extract it to (BeamNG user folder)\levels\(your level)\

    upload_2023-2-17_12-45-15.png


    2. Open art\cubemaps\cubemap_small_island_reflection\main.materials.json and replace all instances of west_coast_usa with your level's folder name.

    upload_2023-2-17_12-45-55.png upload_2023-2-17_12-46-17.png

    3. Open this website: https://matheowis.github.io/HDRI-to-CubeMap/

    4. Upload your HDRI, and click Save.

    5. Select your resolution (2048 preferred) and .hdr for the file type, then the second format option.

    upload_2023-2-17_12-44-19.png

    6. Click Process, wait a bit, then save again. You will see a zip file get downloaded.

    7. Extract the contents of the zip folder to (BeamNG user folder)\levels\(your level)\art\cubemaps\standard_cube_map\

    upload_2023-2-17_12-47-15.png


    8. Open each file in the folder (the .hdr file you just extracted as well as the .dds files) in Photoshop. You cannot open all 6 .dds files at the same time, restart Photoshop after opening and saving a few.

    upload_2023-2-17_15-0-33.png

    9. The .hdr file will have six parts. Each of these parts is a face of the cubemap. The .dds files they correspond to is as follows:

    1 - px.dds
    2 - nx.dds
    3 - nz.dds
    4 - pz.dds
    5 - py.dds
    6 - ny.dds


    Copy each part of the .hdr file over each .dds file in that order.

    10. Save each DDS file using the NVIDIA texture plugin. Select BC6H format. If colors appear too bright and/or washed out in the preview or in game, lower multiplication for each color channel but NOT the alpha channel.

    upload_2023-2-17_15-2-25.png
    upload_2023-2-17_15-3-12.png

    11. Open BeamNG.drive and select the map you chose.
    upload_2023-2-17_15-8-4.png

    12. Once the map loads, open the World Editor (F11).
    upload_2023-2-17_15-10-44.png

    13. Click the "Create Object" button, then click Skybox.
    upload_2023-2-17_15-11-4.png
    upload_2023-2-17_15-11-21.png

    14. Go to the Inspector and select Material, and search for "Skybox03". At this point your skybox should appear, but your lighting will be incorrect. It will be fixed in later steps. If it is too bright or colors are missing, go back to step 10.
    upload_2023-2-17_15-11-53.png
    upload_2023-2-17_15-15-10.png

    15. Delete any and all cloud objects.
    upload_2023-2-17_15-14-25.png

    16. Search for "sky" in the Scene Tree, and click sunsky (or similar)
    upload_2023-2-17_15-21-17.png

    17. Adjust azimuth and elevation until the sun matches with the skybox's sun.
    upload_2023-2-17_15-21-26.png

    18. Search for the time of day object (usually TOD) and delete it.
    upload_2023-2-17_15-21-35.png

    19. Go to the level's origin (0,0,0) where you will find the skybox object. Copy it into the SceneTree. This is important as otherwise the skybox will not be saved when exiting the level.
    upload_2023-2-17_15-24-59.png

    20. Save the level.

    At this point you are done, but you may further tweak the level's objects in order to get it looking better.

    screenshot_2023-02-17_15-29-41.png

    To revert changes, delete the level folder in (BeamNG user folder)\levels.
     
    • Like Like x 8
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice