sheson Posted September 17, 2023 Author Posted September 17, 2023 41 minutes ago, Mousetick said: Well this goes to show I'm still very much ignorant. The pine branches LOD textures found in the DynDOLOD object LOD atlas clearly show they are a downsampled version of the original treepineforestbranchcomp.dds texture, taking into account the NiAlphaProperty threshold of the 3D tree LOD models. I have not run TexGen since one month ago. So they must be generated by something, which is neither TexGen nor LODgen. But what exactly shall remain a mystery. Maybe Texconv during DynDOLOD generation. treepineforestbranchcomp.dds > DynDOLOD_Tamriel.dds I'm sorry but this doesn't help at all. I was wondering how the Direct + Ambient lighting settings in TexGen, which indirectly affect brightness, and the Billboard brightness setting in DynDOLOD, affect each other in combination, and how/why one might be used rather than the other. https://dyndolod.info/Help/TexGen: https://dyndolod.info/Help/Ultra-Tree-LOD But it's ok. I appreciate the time and patience you've given me, especially during a week-end. I won't be bothering you any more and wasting your time with "stupid" questions. https://dyndolod.info/Help/3D-Tree-LOD-Model DynDOLOD reads the alpha threshold from the NiAlphaProperty from the models used for LOD and adjusts the textures before it is added to the atlas texture https://dyndolod.info/DynDOLOD-Reference ... xLODGen scans the world for applicable references, builds the required texture atlases ... DynDOLOD improves the texture atlas creation. https://dyndolod.info/DynDOLOD-Reference#8-Generate-object-LOD In 3D there is by default a direct light (sun) and ambient light. You can see/test this better in NifSkope but also in the TexGen preview. Ambient comes from all directions so its like brightness of the scene and direct light illuminates things from a specific direction. This controls the 3D scene for the render. Normal maps are a bump map, so the smoothness controls the max height of the rendered bump map. Again, this can be previewed in TexGen. These things are fundamental 3D stuff that you can google and then read tons and tons of papers and wikis about it. The brightness drop down for billboards is the same as the xLODGen brightness dropdown and affects the billboard textures before they are being added to the atlas. It a combination of adding (brightness) and multiplying (contrast) that Zilav originally came up with.
Mousetick Posted September 18, 2023 Posted September 18, 2023 Thanks for your answers. 16 hours ago, sheson said: https://dyndolod.info/Help/3D-Tree-LOD-Model DynDOLOD reads the alpha threshold from the NiAlphaProperty from the models used for LOD and adjusts the textures before it is added to the atlas texture Is there a DynDOLOD configuration setting, like there are in TexGen for Stitched/Rendered textures, to control the size of the generated 3D tree LOD model textures before they're added to the atlas? If not, what is the fixed size? 16 hours ago, sheson said: In 3D there is by default a direct light (sun) and ambient light. You can see/test this better in NifSkope but also in the TexGen preview. Ambient comes from all directions so its like brightness of the scene and direct light illuminates things from a specific direction. This controls the 3D scene for the render. Normal maps are a bump map, so the smoothness controls the max height of the rendered bump map. Again, this can be previewed in TexGen. These things are fundamental 3D stuff that you can google and then read tons and tons of papers and wikis about it. The brightness drop down for billboards is the same as the xLODGen brightness dropdown and affects the billboard textures before they are being added to the atlas. It a combination of adding (brightness) and multiplying (contrast) that Zilav originally came up with. Yes, that's all very clear, thanks. But that still doesn't address my query Let's see if I can formulate it differently: To an uneducated outsider reading the DynDOLOD documentation, both TexGen's Direct/Ambient and DynDOLOD Billboard brightness settings have, superficially, the same effects: TexGen: "Lower numbers mean less light strength = darker." DynDOLOD: "Negative Billboard Brightness values will make the billboard tree LOD darker." Each use their own method (external illumination of 3D model before rendering vs. transformation of texture pixels), but their result is descriptively and in appearance similar. In other words, these features/settings seem redundant to an uneducated outsider, which is the source of my confusion. But they must exist and be provided for separate reasons and purposes. So I'd like you to explain, with your expertise and insight, when should one method be used rather than the other, and why, and whether it makes sense to use both at the same time. Hope this is clearer this time? Thanks for your attention.
sheson Posted September 18, 2023 Author Posted September 18, 2023 2 hours ago, Mousetick said: Is there a DynDOLOD configuration setting, like there are in TexGen for Stitched/Rendered textures, to control the size of the generated 3D tree LOD model textures before they're added to the atlas? If not, what is the fixed size? https://dyndolod.info/Help/Advanced-Mode#Object-LOD Max tile size LOD sets the maximum resolution a single object LOD texture can occupy on the object LOD texture atlas. Typically set to match the vertical screen resolution, e.g 1024 for 1080p/1440p, 2048 for 2160p etc. Max tile size full sets the maximum resolution a single full texture can occupy on the object LOD texture atlas. Typically set to 1/4 of the vertical screen resolution, e.g. 256 for 1080p/1440p, 512 for 2160p etc. 2 hours ago, Mousetick said: To an uneducated outsider reading the DynDOLOD documentation, both TexGen's Direct/Ambient and DynDOLOD Billboard brightness settings have, superficially, the same effects: TexGen: "Lower numbers mean less light strength = darker." DynDOLOD: "Negative Billboard Brightness values will make the billboard tree LOD darker." Each use their own method (external illumination of 3D model before rendering vs. transformation of texture pixels), but their result is descriptively and in appearance similar. In other words, these features/settings seem redundant to an uneducated outsider, which is the source of my confusion. But they must exist and be provided for separate reasons and purposes. So I'd like you to explain, with your expertise and insight, when should one method be used rather than the other, and why, and whether it makes sense to use both at the same time. Hope this is clearer this time? Thanks for your attention. Shining light onto a 3D model that is the rendered to a texture is fundamentally different to changing the RGB values of a texture. The features are explained for anyone to use how they see fit. Similar results can be achieved if all you want is to make textures bit darker or brighter, however TexGen settings only apply to the textures it generates. Again, the brightness setting in DynDOLOD is the same as from xLODGen. It exists since years before there was TexGen. It applies to all installed billboards.
Mousetick Posted September 18, 2023 Posted September 18, 2023 1 hour ago, sheson said: https://dyndolod.info/Help/Advanced-Mode#Object-LOD Max tile size LOD sets the maximum resolution a single object LOD texture can occupy on the object LOD texture atlas. Typically set to match the vertical screen resolution, e.g 1024 for 1080p/1440p, 2048 for 2160p etc. Max tile size full sets the maximum resolution a single full texture can occupy on the object LOD texture atlas. Typically set to 1/4 of the vertical screen resolution, e.g. 256 for 1080p/1440p, 512 for 2160p etc. In the case of the downsampled and alpha threshold-adjusted version of treepineforestbranchcomp[snow[l]].dds generated by DynDOLOD for the 3D tree LOD crowns, is this texture considered "a single object LOD texture" or "a single full texture" for adding it to the atlas? 1 hour ago, sheson said: Similar results can be achieved if all you want is to make textures bit darker or brighter, however TexGen settings only apply to the textures it generates. Again, the brightness setting in DynDOLOD is the same as from xLODGen. It exists since years before there was TexGen. It applies to all installed billboards. So my takeaway from all this is that, since 3rd party tree LOD billboards should never be used and tree LOD billboards should always be generated with TexGen, there is no reason to ever use DynDOLOD's brightness setting. Thanks.
sheson Posted September 18, 2023 Author Posted September 18, 2023 13 minutes ago, Mousetick said: In the case of the downsampled and alpha threshold-adjusted version of treepineforestbranchcomp[snow[l]].dds generated by DynDOLOD for the 3D tree LOD crowns, is this texture considered "a single object LOD texture" or "a single full texture" for adding it to the atlas? treepineforestbranchcomp[snow[l]].dds is obviously not a LOD texture since it doesn't have LOD in the filename.
Mousetick Posted September 18, 2023 Posted September 18, 2023 10 hours ago, sheson said: treepineforestbranchcomp[snow[l]].dds is obviously not a LOD texture since it doesn't have LOD in the filename. Ok. Out of curiosity, I tried Max tile size full = 512 which theoretically is overkill for my vertical resolution (1200). Even though it expectedly resulted in more details in both shape and color in the atlas, it didn't make any perceptible difference in-game (too far to see). I've increased the alpha threshold up to 224, from the initial 112. This makes the 3D tree LODs almost virtually indistinguishable in-game shape-wise from the full models with regards to skinniness, unless I really focus on them. So I'm pretty happy about the improvement. I'm now preoccupied with the overall/dominant color of the downscaled treepineforestbranchcomp[snow[l]].dds in the atlas. It seems "off" compared to the full texture, it makes the 3D tree LOD branches look "solid/flat" and "blocky" in-game. May I ask which resampling algorithm is used to generate the atlas texture? Comparison: original full 4K | paint.net Bicubic downscale to 256 | DynDOLOD downscale to 256 + alpha filtering Initially I thought DynDOLOD's version had a "brownish" bias (too much red), but the tints appear to be actually correct. It seems to me the actual issue is that the DynDOLOD version has very little gradation in saturation. Every pixel looks to be max saturated. RGB Perceptual Histogram: paint.net Bicubic downscale to 256 | DynDOLOD downscale to 256 + alpha filtering Thanks in advance for your input.
sheson Posted September 19, 2023 Author Posted September 19, 2023 9 hours ago, Mousetick said: May I ask which resampling algorithm is used to generate the atlas texture? Lanczos in "myfilter" ..\DynDOLOD\Edit Scripts\DynDOLOD\Shaders\stitched.frag If you want to replicate/compare the mipmap generation, also change the alpha of the largest resolution and then of every mipmap that is used. https://dyndolod.info/Help/3D-Tree-LOD-Model Note that by default mipmaps of textures that are added to the tree LOD or object LOD texture atlas are ignored and instead are generated from the largest resolution with an alpha-to-coverage algorithm so that small details do not fade into full transparency the further away they are. To use the mipmaps of the original texture defined by the LOD model, add the term UseMipMaps to the BSTriShape/NiTriShape name. This should preferably be done for all LOD models using this texture. Use an unique filename for such textures, so there are no problems with other mods modifying the same vanilla filenames.
Mousetick Posted September 19, 2023 Posted September 19, 2023 5 hours ago, sheson said: If you want to replicate/compare the mipmap generation, also change the alpha of the largest resolution and then of every mipmap that is used. I didn't understand, sorry. Why would I need to change the alpha of the original texture, and what would I need to change it to? I don't have the tools to view/compare mipmaps, so this may be moot anyway. 5 hours ago, sheson said: Note that by default mipmaps of textures that are added to the tree LOD or object LOD texture atlas are ignored and instead are generated from the largest resolution with an alpha-to-coverage algorithm so that small details do not fade into full transparency the further away they are. To use the mipmaps of the original texture defined by the LOD model, add the term UseMipMaps to the BSTriShape/NiTriShape name. This should preferably be done for all LOD models using this texture. Use an unique filename for such textures, so there are no problems with other mods modifying the same vanilla filenames. I'd read that before and thought it looked important and relevant to my situation, but most of it flew right over my head. I think it makes more sense now. So the full-on/full-off pixels in DynDOLOD's generated atlas texture are the results of alpha-to-coverage? The mipmaps of the original texture look ok to me in-game at roughly the same viewing distance as LOD Level 4: the branches of the full models are opaque and don't look "decimated". But perhaps the game itself uses alpha-to-coverage for compositing vegetation at small resolution? If that's the case, I'm screwed. Let me give the UseMipMaps a try. Back to NifSkope... So for example, in treepineforest01passthru_lod.nif, I would add UseMipMaps to the crown BSTriShape name: TreePineForest01_1:1 ScaleXY Crown UseMipMaps Does it look right? Thanks.
sheson Posted September 19, 2023 Author Posted September 19, 2023 25 minutes ago, Mousetick said: I didn't understand, sorry. Why would I need to change the alpha of the original texture, and what would I need to change it to? I don't have the tools to view/compare mipmaps, so this may be moot anyway. You are comparing a resize without alpha change to a resize with alpha change. 25 minutes ago, Mousetick said: I'd read that before and thought it looked important and relevant to my situation, but most of it flew right over my head. I think it makes more sense now. So the full-on/full-off pixels in DynDOLOD's generated atlas texture are the results of alpha-to-coverage? The mipmaps of the original texture look ok to me in-game at roughly the same viewing distance as LOD Level 4: the branches of the full models are opaque and don't look "decimated". But perhaps the game itself uses alpha-to-coverage for compositing vegetation at small resolution? If that's the case, I'm screwed. https://dyndolod.info/Help/3D-Tree-LOD-Model Note that LOD only has binary alpha with a fixed threshold of 128. It does not really matter how nice an alpha channel looks when looking at a texture in program. In LOD a pixel either shows 100% or not. If mipmaps do not fade into full transparency it is because they have been generated with alpha-to-coverage. 25 minutes ago, Mousetick said: So for example, in treepineforest01passthru_lod.nif, I would add UseMipMaps to the crown BSTriShape name: TreePineForest01_1:1 ScaleXY Crown UseMipMaps Does it look right? Yes, you added the term UseMipMaps to a shape name as explained by the instructions.
IskanderStep Posted September 19, 2023 Posted September 19, 2023 On 8/27/2023 at 12:04 AM, IskanderStep said: Hi, i downloaded the testversion, made a clean save, generated the whole bunch etc. Whatever you did, it works ! The bridge is there and the ...Glow.Lod.. is gone. Thx ! If you need further information etc. just let me know. Iskander Hi, i am really sorry to bring this topic up again, but the bridge in whiterun is gone again . The ingame datetime: Turdas 1850 0611 4E202 I hope you remember what you did to fix it in the first place and have an idea why the fix was not as complete as we both thought. I assume it had something to do with "seasons" or "simplicity of snow" ? I did'nt do screens etc. as i did that in the first place. If i can help you nonethless, please let me know. With best regards Iskander
Mousetick Posted September 19, 2023 Posted September 19, 2023 9 minutes ago, sheson said: It does not really matter how nice an alpha channel looks when looking at a texture in program. In LOD a pixel either shows 100% or not. Yes that's true and I agree. But since LOD uses binary alpha and we don't care about transparency, we can remove the alpha by compositing the texture with a solid background. Before with Alpha > After compositing Anything that is not white background is 100 alpha (full opaque). Background is 0 alpha (full transparent). This can be combined with alpha threshold filtering, applied before compositing with the background. The gradation in shades and saturation is retained.
sheson Posted September 19, 2023 Author Posted September 19, 2023 30 minutes ago, Mousetick said: Yes that's true and I agree. But since LOD uses binary alpha and we don't care about transparency, we can remove the alpha by compositing the texture with a solid background. Before with Alpha > After compositing Anything that is not white background is 100 alpha (full opaque). Background is 0 alpha (full transparent). This can be combined with alpha threshold filtering, applied before compositing with the background. The gradation in shades and saturation is retained. You changed the color of not 100% opaque pixels to contain white. In the real world/game it does not work like that. What you achieved is to create an image that looks similar to the alpha checkerboard background preview of the program. Change the program to actually show the color of all pixels and the alpha channel as mask that can be turned off. Look up premultiplied alpha and alpha blending. Maybe start with this https://developer.nvidia.com/content/alpha-blending-pre-or-not-pre
Mousetick Posted September 19, 2023 Posted September 19, 2023 1 hour ago, Mousetick said: To use the mipmaps of the original texture defined by the LOD model, add the term UseMipMaps to the BSTriShape/NiTriShape name. This should preferably be done for all LOD models using this texture. 'preferably' or 'absolutely'? I have edited all 5 treepineforest*passthru_lod.nif meshes but I know there is at least another one which uses the same texture. I don't see any difference in-game. Is there a way to check in the log(s) that UseMipMaps is taken into account? If this doesn't work out, I'll drop this and move on... ... to the last niggling "issue" before I reach tree LOD nirvana. The lighting effect on the branches of the 3D tree LOD crown is very nice as a whole, but is there a way to "tone it down" a bit? It looks too bright to me. I tried to counter-balance it by darkening the crowns with ; Vertexcolor multipliers for tree LOD models used in object LOD, see https://dyndolod.info/Help/Ultra-Tree-LOD ; CrownBrightness=1 CrownBrightness=0.75 but it's not the right approach, as it makes the snowy trees branches grey for example. Sometimes the lighting clashes with full model trees in the foreground which are not illuminated as brightly. Also it seems to affect the color? Thanks.
sheson Posted September 19, 2023 Author Posted September 19, 2023 2 hours ago, Mousetick said: 'preferably' or 'absolutely'? I have edited all 5 treepineforest*passthru_lod.nif meshes but I know there is at least another one which uses the same texture. I don't see any difference in-game. Is there a way to check in the log(s) that UseMipMaps is taken into account? If this doesn't work out, I'll drop this and move on... If there is one or more NIF using that texture and not settings that, it might not work consistently. It would be best to copy the texture to a unique new filename and update the NIF to use that instead. There is no dedicated debug log message but you can check for the absence of log messages like this: [dynGenerateMipMaps] <Debug: Textures\landscape\trees\treepineforestbranchcomp.dds 2 hours ago, Mousetick said: The lighting effect on the branches of the 3D tree LOD crown is very nice as a whole, but is there a way to "tone it down" a bit? It looks too bright to me. I tried to counter-balance it by darkening the crowns with ; Vertexcolor multipliers for tree LOD models used in object LOD, see https://dyndolod.info/Help/Ultra-Tree-LOD ; CrownBrightness=1 CrownBrightness=0.75 but it's not the right approach, as it makes the snowy trees branches grey for example. Sometimes the lighting clashes with full model trees in the foreground which are not illuminated as brightly. Also it seems to affect the color? Thanks. The 3D tree LOD models use 1:1 copies of the full models. Whatever you see are probably effects in the game. If you want to change brightness of individual 3D tree LOD models, you could darken the full texture directly.
Mousetick Posted September 21, 2023 Posted September 21, 2023 On 9/19/2023 at 7:46 PM, sheson said: If there is one or more NIF using that texture and not settings that, it might not work consistently. It would be best to copy the texture to a unique new filename and update the NIF to use that instead. There is no dedicated debug log message but you can check for the absence of log messages like this: [dynGenerateMipMaps] <Debug: Textures\landscape\trees\treepineforestbranchcomp.dds After many, many tries and goof-ups I finally managed to make it work. I was about to give up but it finally dawned on me (yes, I'm slow) that UseMipMaps must be the solution: if both the full models and 3d LOD models use the same mipmaps, they should look quasi-identical at roughly the same viewing distance. Here are some results (CrownBrightness was reverted to 1 in DynDOLOD_SSE.ini): Baseline: Alpha threshold 224 without UseMipMaps Test: Alpha threshold 112 with UseMipMaps Atlas Texture: Baseline > Test This shows DynDOLOD's Lanczos filter and alpha-to-coverage do an excellent job compared to the full texture's mipmap, but somehow the mipmaps of the atlas texture end up very different, as seen in the next screenshots. In-game mid-morning: Baseline > Test In-game afternoon: Baseline > Test This is beautiful, I'm so happy. Thank you very much for your assistance and for bearing with me. Notes: I reverted the Alpha threshold to 112 for the UseMipMaps version, because with 224 the atlas texture and mipmaps were completely decimated, there was almost nothing left I need to tweak the alpha threshold again to correct the lushiness of the 3D LOD models and match it with the full models. I tried to rename the textures paths and filenames in the 3D LOD models in order to make UseMipMaps work, but it didn't work as DynDOLOD requires the same paths and filenames in both the full and 3D LOD models. I didn't want to edit the vanilla meshes, so I made sure to add UseMipMaps to all the 3D LOD models that use treepineforestbranchcomp.dds (treepineforest*passthru_lod.nif + treepineforestdead*passthru_lod.nif). The branches of the 3D LOD models still look rather flat, but I understand this is due to the LOD's binary alpha. There's nothing that can be done. Suggestion for possible future usability improvement: Since the suitability of mipmaps for use by 3D LOD models is an intrinsic property of the full texture, and does not depend on the mesh, it would make sense to specify UseMipMaps separately for specific textures (e.g. in a config file) rather than in each 3D LOD mesh. Thanks for reading.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now