-
-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multisplat shader #174
Comments
Seems to work great! I didn't have time to test with an heightmap right now. Maybe this WE. I don't have any references regarding the ms rendering time. |
Hi @Zylann. I was thinking to give this a go. So I should just follow the same workflow as using the Array one? Would it be possible for you to set it up so you generate the arrays for the user from the separate textures they add? I don't personally worry too much about setting up the texture array, but I think it will scare a lot of people off from using it and they'll just end up sticking with the Classic4. |
@Arnklit I have a terrain texture importer draft in a branch, but I didnt take the time to finish it yet. The main reason being, I can't make a nice UI for it because the importer dock is not as customizable as the inspector (while, at the same time, being a bummer considering this proposal I made a while ago: godotengine/godot#27378). |
@Zylann I would love for that proposal to go through. Makes a ton of sense to me, I remember being confused about where the import settings were when I was starting out and it still breaks my workflow every time I have to change back and forth. But I don't really think I understand why you would need to customize the import inspector to do this. Couldn't you just use the same UI as for Classic4, but allow people to add 16 slots and then have a "Generate/Update Array texture" that people had to click after making changes to the 16 textures and you would generate the array in the background and import it correctly and place it in the terrain data folder? |
If I tie this to the terrain UI you would have to redo all 16 slots on every terrain you make, and would require saving a very big texture array resource next to every terrain. I've seen someone making a game with multiple terrains where textures ended up occuping 2 gigabytes (the rest of the game being only 100Mb), which even prevented him from exporting due to a Godot 3 limitation, so it is desirable to keep it distinct. My plan was to make a standalone texture resource type instead, which describes 2 texture arrays at once (albedo+bump and normal+roughness), and this is what the configuration looks like:
The idea of using the import system was to allows tweaking textures and have them automatically reimport, and also, to benefit from more import options such as compression. It should also be noted that I can't trigger imports from script either: godotengine/godot-proposals#1615 At least, if I make the texture list from the terrain node to make users setup all the kinds of textures this plugin supports, it means it would have to support 4 different situations at once...
It also means users can't edit texture sets if they don't create or edit a terrain first. |
ehm... yeah I guess I hadn't really thought that idea through with my small test terrain usage of your tool... |
Btw how was performance for you? It's one of the nicest shaders but also the most expensive of them all. It's still way below 16ms but 2ms can be a lot when adding up everything else :p |
I'm seeing quite a bit of slowdown on the brushstrokes for some reason? Just using a 50ish size brush it's getting pretty slow? And the undo seems to be broken. Edit: Just tried the standard array shader afterwards and that one is super fast with giant brushes and has no undo errors. |
The multisplat strokes are slow because there are 4 splatmaps to edit at once, that doesn't come for free :p (also I suspect this hasn't been accelerated with GDNative yet). |
That's from the undo. That's the bigger problem right now. It doesn't seem undo is working correctly. It's fine with both Classic4 and the Array shader. |
Does it happen too if you do the following steps?
Also, does it happen too if you get the latest version from master? It is possible that bug was fixed with 7c1c0e8 |
Okay i didn't see you last commit 7c1c0e8. My bad. |
Going to close now since the feature is in master |
This is to present a new shader I've been working on shortly after releasing the
ARRAY
shader, because while it has relatively simple code, it is hard to get right and has a few blending issues.This new shader is nicknamed
MULTISPLAT16
.Pros:
CLASSIC4
ARRAY
)CLASSIC4
: depth blending, normal maps, roughness, holes and fading to globalmap (no triplanar yet, I don't know exactly how to proceed without tripling texture fetches unnecessarily).Cons:
texture
calls) and not all 16 (which would be 32). For comparison, I tested the following frame times (duration of the whole render with vsync disabled in fullscreen, not just the shader, as Godot doesnt provide the tools to measure that):CLASSIC4
: 0.9 msARRAY
: 0.74 msMULTISPLAT16
: 1.93 msThis shader also requires texture arrays to work, so it's like a middle ground between
ARRAY
andCLASSIC4
.I'm still looking for ways to further optimize it, but so far I could not find more tricks to do so. Lowering to 12 materials and blending only 3 is of course a possibility, if considered enough. Fading to globalmap also helps a lot here, because far away pixels can bypass the entire blending system and use the baked albedo instead. Amusingly, putting objects occluding the ground also help (characters, vehicles, grass, trees, roads, buildings), thanks to depth testing avoiding costy ground pixels from being calculated.
It can be tested in the
multisplat
branch for now.Source: https://github.com/Zylann/godot_heightmap_plugin/blob/multisplat/addons/zylann.hterrain/shaders/multisplat16.shader
*materials: not actual materials. In this plugin, one material actually corresponds to 2 textures:
albedo_bump
, andnormal_roughness
.The text was updated successfully, but these errors were encountered: