-
-
Notifications
You must be signed in to change notification settings - Fork 35.6k
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
Consider placing object_space_normal_map property on Texture instead of Material #14291
Consider placing object_space_normal_map property on Texture instead of Material #14291
Conversation
Nuke MeshPhongMaterial documentation Nuke MeshStandardMaterial documentation Add Texture documentation Nuke Material references to new props Nuke new props from MeshNormalMaterial Nuke new props from MeshPhongMaterial Nuke new props from MeshStandardMaterial
It could also be achieved today if @WestLangley's PR #14239 was merged. |
Can you provide some more justification as to why you think this makes more sense on the Texture rather than the Material? |
Apologies, i meant to write:
|
I'm not voting for this approach since properties like |
None of these actually refer to the image data found in the maps though? Those are all actually some values, this here is just a constant.
Please consider comparing this property to something like Ie. the material doesn't need to be told specifically to look at the encoding of some image in a certain way. What should happen if you provide a tangent space normal map but tick the material to display object space normal maps. It seems like a state that no user should ever be able to find themselves in. Such a safety measure shouldn't be limited by the fact that a material can scale some vector that it obtains by looking up some texture. This property happens while that vector is being looked up, its a different stage. |
This is not going to happen so it's irrelevant. It's in the nature of class extension that sometimes things will be easier if the super class has properties that only some subclasses use. This is to be minimised, of course, but it's often the case that it can't be entirely avoided without making the code more complex.
These are just nomenclature issues / semantics, not reasons why the property would be better on Texture. As @Mugen87 points out, doing it this way goes against all the other texture properties on materials. That means that it's inconsistent, which is by far the worst way of doing things in a codebase.
A constant is just a value from a restricted set that's been given a special name to make it memorable.
Over the last year or two, a lot of that has been done by me. Every so often I suggest that other people help, but for some reason they only want to get involved with "important" stuff like nit-picking and blocking other people's PRs 🙄 |
I didn't mean it like that, i just was referring to the same sentence used twice. Imagine there was a typo, you'd have to fix it in two places.
I disagree with this. Changing this property triggers the whole shader to be recompiled into a different shader. Changing the value of https://threejs.org/docs/#api/textures/Texture List of possible properties it's in alignment with and not going against, up for debate:
offset,repeat,rotation and center actually don't belong on the Just consider this code: myMaterial.normalScale(2,2) //want to enhance texture
myMaterial.normalMap.repeat.set(2,2) //want to make the texture more dense
myMaterial.alphaMap.repeat(2,2) //i actually have to call this because the previous line did absolutely nothing If i want to scale normals in UV i have to go through
|
Opted for merging #14239 instead. |
Thanks though! |
I think this makes slightly more sense on
Texture
instead ofMaterial
. Needs to be tested, i'd also propose landing something like this with an example.Related:
#14239
In case of utmost urgency, this functionality can be achieved today by doing: