some noob questions
some noob questions
Hi, i'm using CopperCube as a level editor, but when i test it in my own application it looks very different from when i test with CopperCube, is that some filter or what?
my game:
coppercube:
And, how can i detect what mesh the mouse is in? It's possible to assign name to a mesh and get the name by the position?
What program do you recommend for terrain editing? I saw that CopperCube have it but i can't found...
Thanks for the attention... =)~
my game:
coppercube:
And, how can i detect what mesh the mouse is in? It's possible to assign name to a mesh and get the name by the position?
What program do you recommend for terrain editing? I saw that CopperCube have it but i can't found...
Thanks for the attention... =)~
-
- Competition winner
- Posts: 688
- Joined: Mon Sep 10, 2012 8:51 am
Re: some noob questions
Um... First, CopperCube is completely different than irrlicht because it's written in Javascript, even though it was written by the same guy. I honestly have no idea what he did different, so I can't tell you there.
HOWEVER, I do believe the picture on the bottom has anti-aliasing. I believe irrlicht has that, although the material setting for it might be turned off by default. I'd have to check again... *sigh*
Incidentally, what renderer are you using? Don't use the default renderer ("Software1" as it's labeled) for irrlicht. It can't do very much, and it is progressively falling farther behind the others. I'm not sure if that's what your doing or not, but it may not support anti-aliasing.
... I could be wrong.
Sorry, I don't know of any terrain editor to recommend.
HOWEVER, I do believe the picture on the bottom has anti-aliasing. I believe irrlicht has that, although the material setting for it might be turned off by default. I'd have to check again... *sigh*
Incidentally, what renderer are you using? Don't use the default renderer ("Software1" as it's labeled) for irrlicht. It can't do very much, and it is progressively falling farther behind the others. I'm not sure if that's what your doing or not, but it may not support anti-aliasing.
... I could be wrong.
Sorry, I don't know of any terrain editor to recommend.
Re: some noob questions
Aniso is off in the lower picture, making it look that much worse (blurry).
Re: some noob questions
I searched for filters like antialising in the docs but didn't found, and never heard about aniso, where can i see the filters and how to activate them?
No, i'm using OpenGL, i usually use directx because it's faster, but the DLL for win32 gcc don't support it and i'm not having performance issues yet(and by the FPS running on the demos i saw, i'll probably never have).chronologicaldot wrote: what renderer are you using? Don't use the default renderer
Re: some noob questions
There is a lot of noise in the first example but not the second. Could it simply be that mipmaps are not in use, that is, bilinear filtering is off in the first example?
Re: some noob questions
If off is the default, yes, how can i on/off filters? I found some types of filters in the docs, but not a function to activate it... Here is my code:mongoose7 wrote:There is a lot of noise in the first example but not the second. Could it simply be that mipmaps are not in use, that is, bilinear filtering is off in the first example?
statemanager.cpp:
Code: Select all
#include "statemanager.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
void StateManager::setupSceneManager(IrrlichtDevice* dr)
{
mSceneManager = dr->getSceneManager();
mSceneManager->loadScene("data/maps/dungeons/dg1.irr");
mCamera = mSceneManager->addCameraSceneNodeFPS(0, 50.f, 0.1f);
setupCollision();
}
void StateManager::setupCollision()
{
IMetaTriangleSelector* meta = mSceneManager->createMetaTriangleSelector();
core::array<ISceneNode*> nodes;
mSceneManager->getSceneNodesFromType(scene::ESNT_ANY, nodes);
mSceneManager->getSceneNodesFromType(scene::ESNT_ANY, nodes);
for (u32 i=0; i < nodes.size(); ++i)
{
scene::ISceneNode * node = nodes[i];
scene::ITriangleSelector * selector = 0;
switch(node->getType())
{
case scene::ESNT_CUBE:
case scene::ESNT_ANIMATED_MESH:
// Because the selector won't animate with the mesh,
// and is only being used for camera collision, we'll just use an approximate
// bounding box instead of ((scene::IAnimatedMeshSceneNode*)node)->getMesh(0)
selector = mSceneManager->createTriangleSelectorFromBoundingBox(node);
break;
case scene::ESNT_MESH:
case scene::ESNT_SPHERE: // Derived from IMeshSceneNode
selector = mSceneManager->createTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break;
case scene::ESNT_TERRAIN:
selector = mSceneManager->createTerrainTriangleSelector((scene::ITerrainSceneNode*)node);
break;
case scene::ESNT_OCTREE:
selector = mSceneManager->createOctreeTriangleSelector(((scene::IMeshSceneNode*)node)->getMesh(), node);
break;
default:
// Don't create a selector for this node type
break;
}
if(selector)
{
// Add it to the meta selector, which will take a reference to it
meta->addTriangleSelector(selector);
// And drop my reference to it, so that the meta selector owns it.
selector->drop();
}
}
ISceneNodeAnimator* anim = mSceneManager->createCollisionResponseAnimator(
meta, mCamera, core::vector3df(5,5,5),
core::vector3df(0,0,0));
meta->drop(); // I'm done with the meta selector now
mCamera->addAnimator(anim);
anim->drop(); // I'm done with the animator now
mCamera->setPosition(core::vector3df(0.f, 20.f, 0.f));
ISceneNode * cube = mSceneManager->getSceneNodeFromType(ESNT_CUBE);
if(cube)
mCamera->setTarget(cube->getAbsolutePosition());
}
void StateManager::drawScene()
{
mSceneManager->drawAll();
}
void StateManager::changeScene(const char* path, core::vector3df frompos)
{ //to-do: criar sistema de portas/portais e derivados para saber qual é a nova posição da camera a partir da posição antiga
mSceneManager->clear();
mSceneManager->loadScene(path);
setupCollision();
}
Code: Select all
#ifndef STATEMANAGER_HEADERFILE
# define STATEMANAGER_HEADERFILE
# include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
class StateManager
{
private:
StateManager(){}
const char* mPath;
ISceneManager* mSceneManager;
ICameraSceneNode* mCamera;
void setupSceneManager(IrrlichtDevice* device);
void setupCollision();
public:
static StateManager* getInstance(IrrlichtDevice* device)
{
static StateManager* inst;
if(inst)
return inst;
inst = new StateManager();
inst->setupSceneManager(device);
return inst;
}
void changeScene(const char* path, core::vector3df frompos);
void drawScene();
};
#endif
Code: Select all
#include <irrlicht.h>
#include "statemanager.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main()
{
IrrlichtDevice *device =
createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 32,
false, false, false, 0);
if (!device)
return 1;
device->setWindowCaption(L"Dimension Door");
IVideoDriver* driver = device->getVideoDriver();
StateManager* state_manager = StateManager::getInstance(device);
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
state_manager->drawScene();
driver->endScene();
}
device->drop();
return 0;
}
Re: some noob questions
Already turned on/off Antialising and mipmaps, nothing changed...
Here is how i turned on antialising:
mipmaps(turned on and off, nothing changed):
Here is how i turned on antialising:
Code: Select all
irr::SIrrlichtCreationParameters params;
params.DriverType=EDT_OPENGL;
params.WindowSize=dimension2d<u32>(800, 600);
params.Bits=32;
params.Fullscreen=false;
params.Stencilbuffer=true;
params.Vsync=true;
params.AntiAlias=true;
params.EventReceiver=0;
IrrlichtDevice *device = createDeviceEx(params);
Code: Select all
driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, true);
Re: some noob questions
The other filters are in the material-settings (TextureLayer settings in SMaterial). You can access them from the scenenode or per meshbuffer.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: some noob questions
i setted on anisotropic filter(various values), trillinear filter and LODBias(positive and negative values), nothing changed...
Re: some noob questions
Strange - you should really see a difference when switching filters... how does the code you used there look like?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: some noob questions
The code to change filters:CuteAlien wrote:Strange - you should really see a difference when switching filters... how does the code you used there look like?
Code: Select all
node->getMaterial(node->getMaterialCount()).TextureLayer->AnisotropicFilter = 16;
node->getMaterial(node->getMaterialCount()).TextureLayer->TrilinearFilter = true;
node->getMaterial(node->getMaterialCount()).TextureLayer->LODBias = 256;
Code: Select all
core::array<ISceneNode*> nodes;
mSceneManager->getSceneNodesFromType(scene::ESNT_ANY, nodes);
for (u32 i=0; i < nodes.size(); ++i)
{
scene::ISceneNode * node = nodes[i];
Re: some noob questions
It looks as if you are writing to the material after the last material, that is, into (outer) space! I think you need a 'for' loop:
for (i < node->getMaterialCount) node->getMaterial(i).TextureLayer->AnisotropicFilter = 16;, etc.
for (i < node->getMaterialCount) node->getMaterial(i).TextureLayer->AnisotropicFilter = 16;, etc.
Re: some noob questions
Nothing changed...
Here is my code:
Here is my code:
Code: Select all
for (u32 i = 0; i < node->getMaterialCount(); i++)
{
node->getMaterial(i).TextureLayer->AnisotropicFilter = 16;
node->getMaterial(i).TextureLayer->TrilinearFilter = true;
node->getMaterial(i).TextureLayer->LODBias = 64;
}
Re: some noob questions
Does that even compile? Texturelayer is not a pointer.
Re: some noob questions
it should work because Texturelayer is an array. so he accessed the first element.
node->getMaterial(i).TextureLayer[0].AnisotropicFilter = 16; should be better so other can see that is an array
do you have more than one texture? if so you have to loop through the other texturelayers
node->getMaterial(i).TextureLayer[0].AnisotropicFilter = 16; should be better so other can see that is an array
do you have more than one texture? if so you have to loop through the other texturelayers