Skip to content
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

Wield Items are Shaded Incorrectly #6697

Closed
Jordach opened this issue Nov 27, 2017 · 4 comments
Closed

Wield Items are Shaded Incorrectly #6697

Jordach opened this issue Nov 27, 2017 · 4 comments
Labels
@ Client / Audiovisuals @ Client rendering Not a bug The behaviour is working as intended and won't be changed

Comments

@Jordach
Copy link
Contributor

Jordach commented Nov 27, 2017

This is from git commit 20a85d7 (or last known sfan5 windows build)

When compared against the same texture generated for an entity, (64x64 texture in the Minecraft 1.8 format) it is generally darker than the entity, and the player entity in third person.

Code relevant to this issue (generates both colour for both wield item and player entities);

https://github.com/Jordach/Solar_Plains/blob/master/mods/wardrobe/init.lua#L899

and

https://github.com/Jordach/Solar_Plains/blob/master/mods/wardrobe/hands.lua#L36

A visual demonstration of this issue can be seen here:

https://jordach.net/images/duggcklzgpllfucve.png

(Both models use the same base skin texture and clothing parts.)

Where, given the hex value #FFFFFF, the wield item turns into a medium grey, or #9f9f9f and #c6c6c6 hex values, respectively. This also occurs on regular, extruded tools, such as a pickaxe or shovel.

This shading is almost consistent with world mesh - but is inconsistent with entity meshes, which use the same set of origin textures.

This can lead to wield items looking wrong despite the original texture looking fine in the first place.

Edit:

Potential solutions - give wield meshes a brightness level (and side shading) that is closer to entities rather than world mesh.

Alternatively, for the challenge, unify the shading algorithms between the world, wield and entity mesh systems.

@sfan5 sfan5 added @ Client / Audiovisuals @ Client rendering Bug Issues that were confirmed to be a bug labels Nov 27, 2017
@numberZero
Copy link
Contributor

screenshot_20171229_023916

Shaders enabled, tone mapping disabled.
The difference is negligible. 0.4.16 looks the same. So the problem is not in the wield mesh, but either in the mod or in texture combining.

@paramat paramat added Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible and removed Bug Issues that were confirmed to be a bug labels Dec 29, 2017
@paramat paramat added Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible labels Oct 9, 2018
@paramat
Copy link
Contributor

paramat commented Oct 9, 2018

When the player view is level, the wielditem is unaligned to the world, tilted forward, and you view the sides of the object not the top. Since face shading depends continuously on face angle it is expected that wielditem faces would have slightly different shading to world nodes.
Entity meshes have no face shading at all so will inevitably be brighter, so those are irrelevant. it would make more sense to request that entities are given world shading, there is an issue for that already.
Your image no longer loads, please drag images into comments to host them at GitHub.
So i can't see any issue here.

@paramat paramat closed this as completed Oct 9, 2018
@paramat paramat added Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible and removed Request / Suggestion The issue makes a suggestion for something that should be done but isn't a new feature labels Oct 9, 2018
@numberZero
Copy link
Contributor

@paramat Shading is computed before the wieldmesh is rotated, so should be exactly the same as in world. The difference in color on my screenshot is probably due to blue emphasis or something similar applied to nodes but not to the wieldmesh.

@paramat
Copy link
Contributor

paramat commented Oct 10, 2018

Thanks, seems correct then.
The actual issue here is therefore object shading, players and mobs have no shading, dropped extruded items have (i think) the extrusion side shaded only.
For players and mobs the issue is #6630

@paramat paramat added Not a bug The behaviour is working as intended and won't be changed and removed Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible labels Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Audiovisuals @ Client rendering Not a bug The behaviour is working as intended and won't be changed
Projects
None yet
Development

No branches or pull requests

4 participants