Jump to content
  • 0

[WiP] Community shader PBR support


Exist

Question

Hi, writing about support for the new Community Shaders PBR assets. Hopefully not much would be needed from your side. I will mention some facts I believe are causing issues with LODs. Because the PBR textures are incompatible with vanilla, we use unique paths (textures/pbr/ prefix) to avoid unintended meshes from using one of them and looking wrong. Meshes that use PBR can be distinguished by the Unused01 property in Shader Flags 2. PBR albedo is brighter than vanilla diffuse and is saved in dds with the sRGB flag, which converts it to linear on the gpu. Now the problems:

  1. Some object LODs seem to be using regular textures, for example mountains. Because LODs won't use the PBR shader, using unmodified PBR textures makes it look wrong. This is our issue and I think authors can just generate lower res textures in the vanilla paths that will only be used for these LODs. I don't know how many LODs actually use regular textures but hope not many.
  2. TexGen seems to ignore PBR textures. I suppose TexGen always uses vanilla paths and ignores Texture Set records, otherwise I don't know why this would happen. In this case it would be nice to take texture set paths into account, or check if a PBR path exists before vanilla one. For landscapes we could also have authors generate low res versions at vanilla paths, but it's not viable to do this for everything.
  3. DynDOLOD uses PBR textures, but probably because of the sRGB flag (which converts them to linear) the LODs are too dark. This happens to tree LODs, objects such as farmhouses and nordic ruins seem good, but not sure. This would probably happen in the textures in the previous point too if they weren't ignored. From our experiments vanilla diffuse is roughly halfway between usual PBR albedo brightness in linear and sRGB. So it would be best to do something like apply power of 1/1.5 to make the brightness consistent with vanilla. Ideally it could be multiplied with ambient occlusion and adjusted based on metalness which are in another texture, but that's not needed.

Hopefully I got the reasons for why it doesn't work right, I will include some comparison screenshots and links to PBR assets so you can try it yourself. Thank you for taking the time to read this and I hope this can be supported. Oh and feel free to ping me or others on CS or Cathedral discord, I might forget to check back here for some time.

https://imgsli.com/Mjg5ODQ5
https://imgsli.com/Mjg5ODUy
https://imgsli.com/Mjg5ODU0
https://imgsli.com/Mjg5ODU1

More info about our PBR implementation: https://github.com/doodlum/skyrim-community-shaders/wiki/True-PBR

Some assets to try:

Trees - https://mega.nz/file/dqdzGLwY#jBJFwPIWv7iX314UEKZnHCRvlITLbXI7saLY-4oV6Nw

Farmhouses - https://mega.nz/file/duUxDKiA#mnzDzjBFXEIDq-MFoucOHRJT55wOmbUNHOLZ5JxG3lY

Lots of other stuff - https://onedrive.live.com/?authkey=!AB5oYH6iqIMDkHM&id=C23FB01B59FA671C!2427&cid=C23FB01B59FA671C

Link to comment
Share on other sites

Recommended Posts

  • 0



Missing normal log from first post: https://ufile.io/jt6m77ss
Missing normal log from second post: https://ufile.io/6sqvxzhy

Just now, sheson said:

Also upload bugreport.txt and the normal TexGen log. See https://dyndolod.info/Official-DynDOLOD-Support-Forum#Post-Logs

Did you change the load order or is the texture random?

Second run was just with Freak's gras mod removed.

Link to comment
Share on other sites

  • 0
37 minutes ago, Dowser said:


My apologies, I was only looking at the log folder:
Debug logs: 


Second run: https://ufile.io/ko8hms5e

I just reran to one with Freak's grass mod to regen all 3 logs files: https://ufile.io/r6o9qwxt

Replace TexGenx64.exe/DynDOLODx64.exe with this version https://mega.nz/file/RIpyBSTI#syE9VR5Go08P11mVunPgabmWJQk7l7jBpMz-ENUxDt4

That should hopefully run through.

Link to comment
Share on other sites

  • 0

New test version https://mega.nz/file/ZFgFXD5D#32kUMWdQVnU9TzSb2kWVS0sUvNcRHPiNTLRoq3Ahb5k

Creates on-demand linear full textures used by HD LOD or if using atlas texture might not be be possible. For mountain LOD for example.
Use Texconv with fixed conversion for now, so the sRGBGamma setting in TexGen/DynDOLOD INIs for the OpegnGL shaders has no effect for that atm.

Use ParallaxGen_Diff.json from ParallaxGen 0.5.6 or higher to automatically keep matching LOD models with CRC32 in their filename. Existing 3D tree LOD models should continue to match with this. Make sure to remove all existing patched meshes (that could have LOD) in the load order before running ParallaxGen for the entire load order.

Link to comment
Share on other sites

  • 0

In this test version trees, mountains and possibly landscape works flawlessly. I had trees very dark before, now they are just right. Not sure about the landscapes, I see pbr landscape textures in the output but idk if they are actually used.

Now object LOD is going too bright lol. Farmhouse example:

The-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-Editi

Some objects still use vanilla LOD, for me everything to do with Whiterun:
The-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-Editi

Btw I noticed many PBR textures that are converted keep their full resolution. Idk how this is done with vanilla textures, but I think they could be downscaled by a lot (for example mountains often use 8k textures).

The logs are here: https://ufile.io/5scu080v

Thank you for your time, you're doing great work!

Link to comment
Share on other sites

  • 0
1 hour ago, Exist said:

In this test version trees, mountains and possibly landscape works flawlessly. I had trees very dark before, now they are just right. Not sure about the landscapes, I see pbr landscape textures in the output but idk if they are actually used.

Now object LOD is going too bright lol. Farmhouse example:

The-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-Editi

Some objects still use vanilla LOD, for me everything to do with Whiterun:
The-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-EditiThe-Elder-Scrolls-V-Skyrim-Special-Editi

Btw I noticed many PBR textures that are converted keep their full resolution. Idk how this is done with vanilla textures, but I think they could be downscaled by a lot (for example mountains often use 8k textures).

The logs are here: https://ufile.io/5scu080v

Thank you for your time, you're doing great work!

Focus so far was to make sure all LOD uses the right textures as needed.
Still working on completing the automatic creation of pbr versions for the rendered object LOD textures for all cases, like wrbuildingslod01.dds
All stitched object LOD textures, like the farmhouses, should be covered,.

We still have to determine what the "correct" algorithm and gamma value is for the sRGB to Linear. Since we just take the sRGB diffuse and normal map and use them with the standard shader without being able to use the _p.dds and _rmaos.dds we need to find the best approximation.

Play around with the gamma setting in the TexGen/DynDOLOD INI for the farmhouses until you find the "correct" value and report it. Take note if changing gamma adversely affects tree LOD billboards or not. If required, they can get a dedicated different gamma setting.

Right now it is just baseMap.rgb = pow(baseMap.rgb, vec3(1.0 / gamma)); with gamma defaulting to 2.2. Any input to make it match/work better is welcome. If anyone knows (OpenGL) shader programming, they can play around with the frag shaders in ..\DynDOLOD\Edit Scripts\DynDOLOD\Shaders\ to test what might work best. Closing/Opening the Previews in TexGen will compile the shader.

Full textures converted to linear is done with Texconv which use the more elaborate algorithm with 2.4. It won't be affected by the gamma setting atm. If we know the best method from above, I will try to add it to Texconv.
Most of the linear.dds textures won't be used actually. They are just created as a back up just in case.
Eventually I might just have them resized to the max tile size full or make create a dedicated INI setting for them.

Test landscape with xLODGen terrain LOD generation. It uses texconv exclusively. That will help to demine if its algorithm is better/worse needs adjusting, like being able to change the hardcoded values etc.

Link to comment
Share on other sites

  • 0

 

On 9/4/2024 at 4:09 AM, sheson said:

New test version https://mega.nz/file/ZFgFXD5D#32kUMWdQVnU9TzSb2kWVS0sUvNcRHPiNTLRoq3Ahb5k

Creates on-demand linear full textures used by HD LOD or if using atlas texture might not be be possible. For mountain LOD for example.
Use Texconv with fixed conversion for now, so the sRGBGamma setting in TexGen/DynDOLOD INIs for the OpegnGL shaders has no effect for that atm.

Use ParallaxGen_Diff.json from ParallaxGen 0.5.6 or higher to automatically keep matching LOD models with CRC32 in their filename. Existing 3D tree LOD models should continue to match with this. Make sure to remove all existing patched meshes (that could have LOD) in the load order before running ParallaxGen for the entire load order.

[Window Title]
TexGen

[Main Instruction]
Texconv error 88982F61.

[Content]
"D:\opt\DynDOLOD\Edit Scripts\Texconvx64.exe" -nologo -gpu 0 -y -sepalpha -aw 256  -keepcoverage 0.85 -f DXT1 -bc d -o "D:\opt\DynDOLOD\TexGen_Output\textures" -flist "C:\Users\langf\AppData\Local\Temp\TexGen_SSE\Texconv_1074_1_F237F1608D004BE39D87D3124AF6E2C8.txt"

---

[05:29]     Creating texture D:\opt\DynDOLOD\TexGen_Output\textures\lod\rtwallslod01.dds with D:\opt\DynDOLOD\Edit Scripts\dyndolod\render\skyrim\objects\lod\rtwallslod01.nif
[05:30]  FAILED (88982F61: The image header is unrecognized. )
[05:30] Error: Texconv error 88982F61 "D:\opt\DynDOLOD\Edit Scripts\Texconvx64.exe" -nologo -gpu 0 -y -sepalpha -aw 256 -keepcoverage 0.85 -f DXT1 -bc d -o "D:\opt\DynDOLOD\TexGen_Output\textures" -flist "C:\Users\langf\AppData\Local\Temp\TexGen_SSE\Texconv_1074_1_F237F1608D004BE39D87D3124AF6E2C8.txt"
 

rtwallslod01.nif TexGen_SSE_Debug_log.zip

Link to comment
Share on other sites

  • 0

I was wrong.

 

[Window Title]
TexGen

[Main Instruction]
Texconv error 88982F61.

[Content]
"D:\opt\DynDOLOD\Edit Scripts\Texconvx64.exe" -nologo -gpu 0 -y -sepalpha -aw 256  -keepcoverage 0.85 -f BC7_UNORM -bc q -o "D:\opt\DynDOLOD\TexGen_Output\textures" -flist "C:\Users\langf\AppData\Local\Temp\TexGen_SSE\Texconv_919_1_EC7239C25DE446B9AE098EE48ADA9E6D.txt"

Click on this link for additional explanations and help for this message

For qualified help and advice or to report a problem make a post on the official DynDOLOD support forum.

[Exit TexGen]

[Footer]
Online Help | Support Forum | Copy message to clipboard

TexGen_SSE_Debug_log.zip

Edited by Dowser
Link to comment
Share on other sites

  • 0
11 hours ago, Dowser said:

I was wrong.

 

[Window Title]
TexGen

[Main Instruction]
Texconv error 88982F61.

[Content]
"D:\opt\DynDOLOD\Edit Scripts\Texconvx64.exe" -nologo -gpu 0 -y -sepalpha -aw 256  -keepcoverage 0.85 -f BC7_UNORM -bc q -o "D:\opt\DynDOLOD\TexGen_Output\textures" -flist "C:\Users\langf\AppData\Local\Temp\TexGen_SSE\Texconv_919_1_EC7239C25DE446B9AE098EE48ADA9E6D.txt"

Click on this link for additional explanations and help for this message

For qualified help and advice or to report a problem make a post on the official DynDOLOD support forum.

[Exit TexGen]

[Footer]
Online Help | Support Forum | Copy message to clipboard

TexGen_SSE_Debug_log.zip 1.35 MB · 3 downloads

This test version should fix that Texconv error https://mega.nz/file/RdIn2LjY#4N99nK71ncRxJ8LBF4_I6SzQV3VtO5EnrOtia5So-Ac

TexGen should now also generate all remaining rendered object LOD textures and also use PBR textures for rendered billboards / 3D LOD trunk generation if ParallaxGen_Diff.json contains the CRC32 of the original full model tree for current the patched version.

Link to comment
Share on other sites

  • 0

Hey Sheson, no error log or bug report has been generated. I managed to generate lods and terrain lods very well and they look incredible. I am only noticing one issue that I'm kind of unsure how to report because I don't have any log to provide. It is the lod unloading bug that wskeever has provided a workaround for. In the past in extremely rare cases, it would happen. Now for some reason it seems to happen quite a bit, I'm unfamiliar with it and don't really know how to provide more information but it seems to be occurring very often just about every time i enter/exit a cell.

Again, I have only begun having this bug happen to this extent while using PBR lods. If there is anything more you'd like me to provide let me know.

Link to comment
Share on other sites

  • 0
18 minutes ago, Bottle said:

Hey Sheson, no error log or bug report has been generated. I managed to generate lods and terrain lods very well and they look incredible. I am only noticing one issue that I'm kind of unsure how to report because I don't have any log to provide. It is the lod unloading bug that wskeever has provided a workaround for. In the past in extremely rare cases, it would happen. Now for some reason it seems to happen quite a bit, I'm unfamiliar with it and don't really know how to provide more information but it seems to be occurring very often just about every time i enter/exit a cell.

Again, I have only begun having this bug happen to this extent while using PBR lods. If there is anything more you'd like me to provide let me know.

https://dyndolod.info/Official-DynDOLOD-Support-Forum
The log and debug log are saved when the program shuts down. Do not interrupt the shut down process so it can write the log files. While the new log is appended to older logs, the debug log is replaced every time. Keep a copy somewhere else for future references if required.

https://dyndolod.info/FAQ#Object-LOD-shows-in-active-exterior-cells
Known as stuck object LOD after fast travel engine bug that can happen after fast travel especially to in Whiterun. Consider using the dynamic LOD option of DynDOLOD which should fix that bug. If dynamic LOD is not used, use the LOD Unloading Bug Fix.
Can be caused by [MapMenu] uLockedObjectMapLOD=32 in Skyrim.ini (or SkyrimCustom.INI or a mod INI), especially if there are no object LOD level 32 meshes (which is the vanilla/default). See Trees on the Map for further explanations. Also see Maps And Map Mods and Seasons if relevant.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.