Skip to content

Devel - #3781

Merged
paroj merged 6 commits into
OGRECave:masterfrom
paroj:devel
Oct 30, 2026
Merged

Devel#3781
paroj merged 6 commits into
OGRECave:masterfrom
paroj:devel

Conversation

@paroj

@paroj paroj commented Oct 29, 2026

Copy link
Copy Markdown
Member

No description provided.

paroj added 2 commits October 30, 2026 00:19
glTF hides a node by keying its scale to zero. parseAnimation composed
each key into a matrix, mapped it into the skeleton parent's space and
decomposed the result; with a zero scale component that matrix is
singular, so the decomposition returned NaN rotation and scale and the
whole track became NaN.

Decompose with the zero components replaced by one and zero the
matching component of the decomposed scale afterwards. Keys without a
zero scale are computed exactly as before.
The loader creates the skeleton manually and never called
Skeleton::setBindingPose(), which SkeletonSerializer does for skeletons
loaded from file. Every bone therefore kept an identity initial state:
entities were unaffected because SkeletonInstance sets its own binding
pose, but Skeleton::reset() on the mesh's skeleton collapsed all bones
to the origin, and animations applied to it started from there.

Set the binding pose once the bone hierarchy is built.
paroj added 4 commits October 30, 2026 15:42
genQuadVertices had three copies of the code writing the four vertices,
one per rotation mode. Only the corners and texcoords differ between
them, so compute these first and share the code writing the vertices.

Keeping the buffer pointer and the billboard position in locals is
needed, as the compiler otherwise reloads them after every write. With
this the function is as fast as before, in fact slightly faster for
unrotated billboards.
…state

preAddToRenderState is called after the scheme and the custom render state are
merged, so a lighting stage that replaces the per-pixel lighting of the
scheme is never instantiated and no longer sets the SO_PHONG marker on the
source pass. ClusteredLightCulling used that marker to check whether
lighting is evaluated per pixel, so it was silently dropped. This happens
in Sample_ShaderSystemMultiLight, where Cook-Torrance replaces the
per-pixel lighting and the sample materials have no metal_roughness map.

Check the resolved render state for the lighting sub render states that
consume the froxel light list instead. They are the only two users of
FroxelLights, which is more precise than the shade option and does not
depend on the order the sub render states are called in.

Add a regression test that links Cook-Torrance with the clustered light
culling on a pass that is not SO_PHONG.
srcPass->setShadingMode(SO_PHONG) marks a pass whose lighting is evaluated
per pixel and is read by sub render states that detect such a pass. It sat
behind the metal_roughness map early return, so it was only set for
materials that configure that texture.

Set the marker as soon as the lighting stage applies, matching what
FFPLighting does for the per-pixel lighting sub render state that
Cook-Torrance replaces.
The hook is called after the scheme and the custom render state have been
merged with the overrides resolved, not before the sub render state is
added. Describe the resolved view it gets, and that sub render states
which are overridden are never instantiated and that the pass must not be
used to pass information between sub render states.
@paroj
paroj merged commit 73bac6a into OGRECave:master Oct 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant