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
GenericCAO models are dark when below y = 0 #6174
Comments
I might know why. Previously player pos was centre of model, now it's foot position, so light is being sampled at foot position, we need to add in a vertical offset to raise this point back up to model centre, or, up by 1 node. If we raise by 0.9 * BS this will be rough model centre. But only for player objects. |
https://github.com/minetest/minetest/blob/master/src/content_cao.cpp#L944
Compare to items:
But i'm concerned about any added offset being applied to all CAOs instead of just players. |
Just so you know, |
Doesn't the player have a seperate subclass of GenericCAO? |
if i remember ItemCAO is obsolete |
Ok. |
This is not just for player models, but for any models. I have seen this for item entities, boats, carts, mobs and pretty much any entity based on a mesh. |
Yes but that's different and a non-issue, that usually happens when the model centre passes into a node, the model centre being the point that determines where light is sampled. |
I also noticed that the nametag is not on top of the player, but rather in the center of the player. |
@paramat No, it is the same issues. Now, players, mobs and other entities use the same code for display and so they (should) show the same behavior. If a mob would be standing at the exact same position like the player in your screenshot, it would be black. The client doesn't even differentiate between other players and luaentities. @bigfoot547 I'll look into it. |
Ok, i thought people were describing the existing behaviour. Obviously mobs should have the same issue. |
#6179 merged. |
It wasn't merged, just done it now. |
Testing on a local server:
Jumping or hovering slightly above a node makes light return, so i suspect that the recent 'player settable collisionbox' change has shifted the point that defines player model light down by a node to feet position, and that being below y = 0 is a sign reversal that puts that point just inside the node below.
If so then when above y = 0, flying very slightly into the ground should make the player go dark too:
Confirmed. So it seems that a 1-node vertical offset was forgotten somewhere.
@TeTpaAka
The text was updated successfully, but these errors were encountered: