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)));
StaticModel* object = objectNode->CreateComponent<StaticModel>();
RigidBody* body = objectNode->CreateComponent<RigidBody>();
// Bigger Rocks will be heavier and harder to move
body->SetMass((scale * 100) * 2.0f);
CollisionShape* shape = objectNode->CreateComponent<CollisionShape>();
Can you toss your Rock.mdl file (specifically the Urho MDL file - not w/e source file it came from), material XML file, and the normal map (if any) on the rock (no other textures should be needed unless you have a specular map on the non-PBR shaders).
I’m suspecting that something is horribly wrong with your tangents or normals.
Except that banding in the corner, which is really bizarre, are there triangles there that align with the banding?
@mrchrissross Are you still setting the linear velocity of the spaceship directly? This would explain the lack of collision. Instead apply forces.
Also, are you sure you’re using collision layers/masks correctly? With the default values everything should collide.
The problem is in your model. I’m surprised it renders at all actually (expected vertex layout errors).
It has normals but does not have tangents. Reconvert it and use the -t flag to generate tangents. That should fix it, apparently vert-layout errors were reduced / smoothed or something in master … that should’ve spat an error at you for even trying to render it with that material.
"Usage: AssetImporter <command> <input file> <output file> [options]\n"
"See http://assimp.sourceforge.net/main_features_formats.html for input formats\n\n"
"model Output a model\n"
"anim Output animation(s)\n"
"scene Output a scene\n"
"node Output a node and its children (prefab)\n"
"dump Dump scene node structure. No output file is generated\n"
"lod Combine several Urho3D models as LOD levels of the output model\n"
" Syntax: lod <dist0> <mdl0> <dist1 <mdl1> ... <output file>\n"
"-b Save scene in binary format, default format is XML\n"
"-j Save scene in JSON format, default format is XML\n"
"-h Generate hard instead of smooth normals if input has no normals\n"
"-i Use local ID's for scene nodes\n"
"-l Output a material list file for models\n"
"-na Do not output animations\n"
"-nm Do not output materials\n"
"-nt Do not output material textures\n"
"-nc Do not use material diffuse color value, instead output white\n"
"-nh Do not save full node hierarchy (scene mode only)\n"
"-ns Do not create subdirectories for resources\n"
"-nz Do not create a zone and a directional light (scene mode only)\n"
"-nf Do not fix infacing normals\n"
"-ne Do not save empty nodes (scene mode only)\n"
"-mb <x> Maximum number of bones per submesh. Default 64\n"
"-p <path> Set path for scene resources. Default is output file path\n"
"-r <name> Use the named scene node as root node\n"
"-f <freq> Animation tick frequency to use if unspecified. Default 4800\n"
"-o Optimize redundant submeshes. Loses scene hierarchy and animations\n"
"-s <filter> Include non-skinning bones in the model's skeleton. Can be given a\n"
" case-insensitive semicolon separated filter list. Bone is included\n"
" if its name contains any of the filters. Prefix filter with minus\n"
" sign to use as an exclude. For example -s \"Bip01;-Dummy;-Helper\"\n"
"-t Generate tangents\n"
"-v Enable verbose Assimp library logging\n"
"-eao Interpret material emissive texture as ambient occlusion\n"
"-cm Check and do not overwrite if material exists\n"
"-ct Check and do not overwrite if texture exists\n"
"-ctn Check and do not overwrite if texture has newer timestamp\n"
"-am Export all meshes even if identical (scene mode only)\n"
"-bp Move bones to bind pose before saving model\n"
"-split <start> <end> (animation model only)\n"
" Split animation, will only import from start frame to end frame\n"
"-np Do not suppress $fbx pivot nodes (FBX files only)\n"