-
Notifications
You must be signed in to change notification settings - Fork 24
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
LabPBR Resource Pack Support/Improvement #431
Comments
I think MCprep would benefit from better LabPBR support. Right now however, we're spread pretty thin, so I've added this as a |
I'll continue looking into this myself as well! :) |
Looking into this further, this should be possible with #274, with some extensions |
Turns out I was missing a map (I'm using the fork I mentioned in #274 (comment)), using a different resource pack works |
One thing I did notice on the LabPBR spec is that the red channel for the specular map doesn't represent linear roughness, it represents “perceptual smoothness”. Thus, conversion is needed, which according to the documentation can be done with the following expression (they use a some function syntax, but I prefer actual math syntax): |
Closing as superseded by #600, which implements a template based material system (and thus covers this as well). Note that this new system however is planned for MCprep 4.0 (which is a ways away) |
Check against existing requests
Describe the context
Overview
I've done quite a bit of research into LabPBR's material standard, and how to implement that properly into Blender for LabPBR resource packs. I've been able to implement a lot of these materials properly, but some are still a bit of a mystery to me and it would be great to have this option included with Specular and SEUS.
Also, this is similar to #78, but I don't think that the extra options for LabPBR have been implemented correctly.
LabPBR packs support the following features:
LabPBR uses packed color/alpha channels on both the Specular and Normal textures to achieve all of these different effects. Most of the values are stored linearly from 0-255, which can create an issue when trying to translate them to a Principled BSDF shader. In my own time, I believe I've found the appropriate way to implement them, but there are a few that I'm a bit unsure of and could use some assistance in assuring they're correctly done.
For ease, I'll describe how LabPBR does this on each texture, and what channels/values represent what!
Textures
For most of these, the values are stored linearly from 0-255. We don't want those values to be translated directly in Blender, as that could leave us open to some issues, so we'll need to create a Map Range node for each value range and their corresponding input on the Principled BSDF shader.
Specular Texture
Red Channel
ShaderLABS describes the Red channel as being "perceptual" smoothness, and stores the values of 0 being fully rough, and 255 being fully smooth. This can easily translate to the Roughness input.
Green Channel
Blue Channel
Alpha Channel
Normal Texture
The normal texture is a bit different, as it uses the Red and Green channel for X and Y values for the normal calculation. These can be combined into the Normal input, but we still have the Blue and Alpha channels.
Blue Channel
Alpha Channel
How do you imagine your feature works?
If an option is given for LabPBR when prepping materials, it'd have the option for the different channels and to implement them properly in the shader nodes for each different block using the specified values. This will require quite a bit of testing to ensure they are represented properly from how the resource pack created them.
What existing workaround (or closest thing to a workaround) do you have today (within Blender, MCprep, or any software)? If there is no workaround, explain why you feel this way.
Blender Implementation
For implementing these textures in Blender, and assuring their values are assigned correctly, I've created the following using the Hardtop VanillaAccurate 32x Resourcepack as an example. It utilizes all of the features of LabPBR 1.2+ packs:
The following is a rough and quick render I did of the block that uses this setup:
However, I'm not sure if these are done correctly, or if there is a better way of doing so. I like to maintain as much creative control as possible with my projects, so I believe I've set this up in the proper way while still allowing control, but some things feel off.
I did create this other shader node setup as well that I personally think looks much better, but it doesn't quite use all of the available information that comes with the textures, and I let Cycles handle a lot of the legwork. Though, this is specific to the style I want to go for in my renders/animations, so take it with a grain of salt. I put it into a group to make it easier to plug into new materials:
And a render of what it looks like:
This is most likely not accurate to how the resource pack looks in Minecraft with shaders, but it's about the best I've been able to do so far and achieve the look that I want. Hopefully this can help in implementing this, and give a good idea on how to approach this.
The text was updated successfully, but these errors were encountered: