File tree Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Expand file tree Collapse file tree 3 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -86,15 +86,20 @@ namespace Skylicht
86
86
87
87
IMeshBuffer* buffer = sky->Buffer ;
88
88
89
- CShaderMaterial::setMaterial (sky->SkySunMaterial );
89
+ SMaterial& mat = buffer->getMaterial ();
90
+ CMaterial* material = sky->SkySunMaterial ;
91
+
92
+ material->updateTexture (mat);
93
+
94
+ CShaderMaterial::setMaterial (material);
90
95
91
96
world.makeIdentity ();
92
97
world.setTranslation (cameraPosition);
93
98
world.setScale (cameraFar * 0 .9f );
94
99
95
100
driver->setTransform (video::ETS_WORLD, world);
96
101
97
- driver->setMaterial (buffer-> getMaterial () );
102
+ driver->setMaterial (mat );
98
103
driver->drawMeshBuffer (buffer);
99
104
}
100
105
}
Original file line number Diff line number Diff line change @@ -246,12 +246,15 @@ namespace Skylicht
246
246
// if change texture or last sprite
247
247
if (i == n - 1 || currentTexture != sprites[i + 1 ]->Frame ->Image ->Texture )
248
248
{
249
- // flush render
250
- m_meshBuffer->getMaterial ().setTexture (0 , currentTexture);
251
249
m_meshBuffer->setDirty ();
252
250
251
+ // flush render
252
+ SMaterial& mat = m_meshBuffer->getMaterial ();
253
+ mat.setTexture (0 , currentTexture);
254
+
253
255
driver->setTransform (video::ETS_WORLD, core::IdentityMatrix);
254
- driver->setMaterial (m_meshBuffer->getMaterial ());
256
+
257
+ driver->setMaterial (mat);
255
258
driver->drawMeshBuffer (m_meshBuffer);
256
259
257
260
// clean
Original file line number Diff line number Diff line change @@ -76,9 +76,10 @@ namespace Skylicht
76
76
CEntity* entity = entities[i];
77
77
78
78
CJointData* joint = GET_ENTITY_DATA (entity, CJointData);
79
- if (joint->RootIndex != 0 )
79
+ CWorldTransformData* transform = GET_ENTITY_DATA (entity, CWorldTransformData);
80
+
81
+ if (transform->NeedValidate && joint->RootIndex != 0 )
80
82
{
81
- CWorldTransformData* transform = GET_ENTITY_DATA (entity, CWorldTransformData);
82
83
CWorldInverseTransformData* rootInvTransform = GET_ENTITY_DATA (allEntities[joint->RootIndex ], CWorldInverseTransformData);
83
84
84
85
if (rootInvTransform != NULL )
You can’t perform that action at this time.
0 commit comments