Last active 7 months ago
Ahh, okay. Thanks!
I found my problem! I wasn't exporting normals in polyimport.
They don't render with lights either.
I imported a mesh and noticed that the only materials that it would render at all with were some of the Unlit shaders. None of the Default materials would render the mesh.
The mesh was textured and had a UV map, if that factors into anything.
Is this due to shaders being incomplete, or am I doing something wrong?
I made a PR for this feature (#698).
Skeletal animation doesn't seem to be working for me in the goodbye_cmake branch. Did something change in how you would play animations?
Here's the code I'm using to initialize the mesh:
mesh = new SceneMesh(globalPool, "character.mesh"); mesh->setMaterial(globalPool->getMaterial("UnlitWireframe")); mesh->setColor(1, 1, 1, 1); scene->addEntity(mesh); mesh->loadSkeleton(core, "character.skeleton"); mesh->getSkeleton()->bonesVisible(true); mesh->getSkeleton()->addAnimation(core, "idle", "idle.anim"); mesh->getSkeleton()->addAnimation(core, "walk", "walk.anim"); mesh->getSkeleton()->setBaseAnimationByName("idle"); mesh->getSkeleton()->playAnimationByName("walk", 0.5, false, false);
And here's the update loop:
bool res = core->Update(); scene->Update(core->getElapsed()); mesh->Roll(1); mesh->Pitch(1); RenderFrame *frame = new RenderFrame(core->getViewport()); scene->Render(frame, NULL, NULL, NULL, false); core->getRenderer()->submitRenderFrame(frame); return res;
I fixed the mesh not rendering by setting a material for the mesh to UnlitUntextured.
This piece of code only renders the SceneLabel, but not the ScenePrimitive box. Am I missing something here?
This was run with the goodbye_cmake branch on a Mac.
scene = new Scene(core, Scene::SCENE_3D); scene->useClearColor = true; ScenePrimitive *box = new ScenePrimitive(ScenePrimitive::TYPE_BOX, 1,1,1); //box->loadTexture("Resources/pink_texture.png"); box->setPosition(0.0, 0.5, 0.0); scene->addChild(box); label = new SceneLabel(globalPool->getMaterial("Unlit"), "Hello World", 32, globalPool->getFont("mono"), Label::ANTIALIAS_FULL, 0.1); scene->addChild(label); scene->getDefaultCamera()->setPosition(3,3,3); scene->getDefaultCamera()->lookAt(Vector3(0,0,0));