[Solved] Plastic cube
[Solved] Plastic cube
Hello,
i want to try to acheive this kind of plastic rendering in my game for cubes&characters but i don't know where to start:
http://www.iikgames.com/bouncyqubes/images/image07.jpg
I tried a toon shader and also many different light settings but that doesn't look like the same, i also tried flat shading but for some reason i can't get this smooth plastic/marshmallow feeling, this look simple but i can't get the same rendering, any hint on how that was done please?
i want to try to acheive this kind of plastic rendering in my game for cubes&characters but i don't know where to start:
http://www.iikgames.com/bouncyqubes/images/image07.jpg
I tried a toon shader and also many different light settings but that doesn't look like the same, i also tried flat shading but for some reason i can't get this smooth plastic/marshmallow feeling, this look simple but i can't get the same rendering, any hint on how that was done please?
Last edited by Grz- on Wed Oct 14, 2009 12:17 pm, edited 1 time in total.
Nop, it's a remake of Q*Bert without the pyramid level style: http://www.iikgames.com/bouncyqubes/
Well i know that theses was not particularly high poly but by looking at the blob shape/ligthing, it seem to be pretty smooth, anyway i will try to make the same kind of mesh and render it with a toon shader, thank.
PS: Looking at the system requirement, it seem this game don't use any shaders, it would be better if i can avoid using shaders too... i don't think toon shader is necessary...
Well i know that theses was not particularly high poly but by looking at the blob shape/ligthing, it seem to be pretty smooth, anyway i will try to make the same kind of mesh and render it with a toon shader, thank.
PS: Looking at the system requirement, it seem this game don't use any shaders, it would be better if i can avoid using shaders too... i don't think toon shader is necessary...
looks like ~80 triangles per block (10 per corner) would be easily enough to match this game (you can see it's fairly low poly). Even less if you don't include the cube bases & other faces you never see.
You don't need to use any special toon stuff - this thing's just using textures with 1 light square and the rest slightly darker. There's not even any lighting.
You don't need to use any special toon stuff - this thing's just using textures with 1 light square and the rest slightly darker. There's not even any lighting.
I tried to make a cube mesh that have round edge and exported it to .obj but now edge are shown by blacks line in irrlicht:
it look like that in Blender:
I used only material color with shadeless option.
Here is the code i use to add the mesh:
The mesh can be downloaded here:
.obj
.mtl
it look like that in Blender:
I used only material color with shadeless option.
Here is the code i use to add the mesh:
Code: Select all
node = smgr->addMeshSceneNode(qbe);
node->setScale(core::vector3df(5.0f,5.0f,5.0f));
node->setPosition(core::vector3df(xOffset,yOffset,zOffset));
node->setRotation(core::vector3df(0.0f,45.0f,0.0f));
node->setMaterialFlag(video::EMF_WIREFRAME,false);
node->setMaterialFlag(video::EMF_LIGHTING,false);
.obj
.mtl
Looks like you had a problem exporting your mesh to me. You could use the 09.MeshViewer example to look at it, or you could use the following code...
As you can see, some of the faces along the edges are flipped. If you leave backface culling on, they will not be rendered. If you fix your mesh, or disable backface culling, then the cube will appear as intended.
Travis
Code: Select all
#include <irrlicht.h>
using namespace irr;
#ifdef _IRR_WINDOWS_
# pragma comment(lib, "Irrlicht.lib")
#endif
int main()
{
IrrlichtDevice *device = createDevice(video::EDT_OPENGL);
if (!device)
return 1;
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
// get a camera
scene::ISceneNode* camera = smgr->addCameraSceneNodeFPS();
const core::vector3df pos(1020.f, 0.f, 1020.f);
camera->setPosition(pos);
// get some background
smgr->addSkyBoxSceneNode(
driver->getTexture("../../media/irrlicht2_up.jpg"),
driver->getTexture("../../media/irrlicht2_dn.jpg"),
driver->getTexture("../../media/irrlicht2_lf.jpg"),
driver->getTexture("../../media/irrlicht2_rt.jpg"),
driver->getTexture("../../media/irrlicht2_ft.jpg"),
driver->getTexture("../../media/irrlicht2_bk.jpg"));
scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/qbe.obj");
scene::ISceneNode* node = smgr->addMeshSceneNode(mesh->getMesh(0));
node->setMaterialFlag(video::EMF_LIGHTING, false);
node->setMaterialFlag(video::EMF_WIREFRAME, true);
//node->setMaterialFlag(video::EMF_BACK_FACE_CULLING, false);
const core::vector3df scl (1000.f, 1000.f, 1000.f);
node->setScale(scl);
while(device->run())
{
if (driver->beginScene(true, true, video::SColor(0,200,200,200)))
{
smgr->drawAll();
driver->endScene();
}
}
device->drop();
return 0;
}
Travis
hey that's looking great good luck
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info