Hi Everyone,
I’m having a little bit of a material issue, material looks great at first however after a slight movement of the camera, it becomes shiny with patterns on it. I don’t know what going on with it, does it have something to do with the directional lighting?
It also seems to happen the further I move away for the models.
Here is the video:
Also with these rocks, I’m able to fly straight through them. I’ve set a collider up but it seems to be having no effect, here is the code to the rocks:
const unsigned NUM_ROCKS = 100;
for (unsigned i = 0; i < NUM_ROCKS; ++i)
{
float scale = Random(0.05f) + 0.001f; // Random(0.2f) + 0.01f;
Node* objectNode = scene_->CreateChild("Rock");
objectNode->SetPosition(Vector3(Random(90.0f) - 45.0f, Random(5.0f) + 5.0f, Random(90.0f) - 45.0f));
objectNode->SetRotation(Quaternion(Random(360.0f), Random(360.0f), Random(360.0f)));
objectNode->SetScale(scale);
StaticModel* object = objectNode->CreateComponent<StaticModel>();
object->SetModel(cache->GetResource<Model>("Models/Rock.mdl"));
object->SetMaterial(cache->GetResource<Material>("Materials/Rock.xml"));
object->SetCastShadows(true);
RigidBody* body = objectNode->CreateComponent<RigidBody>();
body->SetCollisionLayer(2);
// Bigger Rocks will be heavier and harder to move
body->SetMass((scale * 100) * 2.0f);
CollisionShape* shape = objectNode->CreateComponent<CollisionShape>();
shape->SetBox(Vector3::ONE);
}