Page 6 of 10
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Wed Mar 21, 2012 5:48 pm
by Nadro
It looks like a bug in an Octtree Scene Node, I will look onto a bounding box creation process methods once again. Thanks for a report. I will add a doxygen style comments in a header files soon, because You're right that this is an important part of an each project.
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Wed Mar 21, 2012 6:22 pm
by REDDemon
when compiling for windows from c::b I get these errors (just launched compiling using the project file inside the source folder)
..\..\include\IMeshManipulator.h||In member function 'bool irr::scene::IMeshManipulator::createWelded(irr::scene::IMeshBuffer*, irr::f32, bool, bool, bool, bool) const':|
..\..\include\IMeshManipulator.h|396|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|411|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|426|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|441|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|456|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|471|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|486|error: 'CheckComponents' was not declared in this scope|
..\..\include\IMeshManipulator.h|501|error: 'CheckComponents' was not declared in this scope|
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Wed Mar 21, 2012 9:31 pm
by Nadro
I fixed compilation errors in a rev4113.
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Wed Mar 21, 2012 10:20 pm
by REDDemon
wao there are lots of extra lines of code and compiling is taking very long.
...
Finished to compile.
Got compressed textures working also with your branch in the last revision
(the loader code needed no changes, but the example required few changes )
Here's the custom scene node example with compressed textures support

enjoy. (compressed textures + FVF )
Code: Select all
#include <irrlicht.h>
#include <CKhronosTexture.h>
#include <cassert>
#include <iostream>
using namespace irr;
using namespace video;
class CSampleSceneNode : public scene::ISceneNode
{
core::aabbox3d<f32> Box;
scene::IVertexBuffer* VertexBuffer;
scene::IIndexBuffer* IndexBuffer;
video::SMaterial Material;
irr::video::CKhronosTexture * myTexture;
public:
CSampleSceneNode(scene::ISceneNode* parent, scene::ISceneManager* mgr, s32 id)
: scene::ISceneNode(parent, mgr, id)
{
VertexBuffer = new scene::CVertexBuffer<video::S3DVertex>(mgr->getVideoDriver()->getVertexDescriptor(0));
IndexBuffer = new scene::CIndexBuffer(video::EIT_16BIT);
Material.Wireframe = false;
Material.Lighting = false;
myTexture = new CKhronosTexture("example",mgr->getVideoDriver());
io::IReadFile * file = mgr->getFileSystem()->createAndOpenFile("exported.ktx");
std::cout<<"error code:"<<(s32)myTexture->loadTexture( file )<<std::endl; // I just don't check for errors. but I am supposed to check for errors.
file->drop();
Material.setTexture(0,myTexture);
video::S3DVertex Vertices[4];
Vertices[0] = video::S3DVertex(0,0,10, 1,1,0, video::SColor(255,0,255,255), 0, 1);
Vertices[1] = video::S3DVertex(10,0,-10, 1,0,0, video::SColor(255,255,0,255), 1, 1);
Vertices[2] = video::S3DVertex(0,20,0, 0,1,1, video::SColor(255,255,255,0), 1, 0);
Vertices[3] = video::S3DVertex(-10,0,-10, 0,0,1, video::SColor(255,0,255,0), 0, 0);
for (s32 i = 0; i<4; ++i)
VertexBuffer->addVertex(&Vertices[i]);
IndexBuffer->addIndex(0);
IndexBuffer->addIndex(2);
IndexBuffer->addIndex(3);
IndexBuffer->addIndex(2);
IndexBuffer->addIndex(1);
IndexBuffer->addIndex(3);
IndexBuffer->addIndex(1);
IndexBuffer->addIndex(0);
IndexBuffer->addIndex(3);
IndexBuffer->addIndex(2);
IndexBuffer->addIndex(0);
IndexBuffer->addIndex(1);
Box.reset(Vertices[0].Pos);
for (s32 i=1; i<4; ++i)
Box.addInternalPoint(Vertices[i].Pos);
}
~CSampleSceneNode()
{
VertexBuffer->drop();
IndexBuffer->drop();
myTexture->drop();
}
virtual void OnRegisterSceneNode()
{
if (IsVisible)
SceneManager->registerNodeForRendering(this);
ISceneNode::OnRegisterSceneNode();
}
virtual void render()
{
video::IVideoDriver* driver = SceneManager->getVideoDriver();
driver->setMaterial(Material);
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
driver->drawVertexPrimitiveList(false, VertexBuffer, false, IndexBuffer, 4, scene::EPT_TRIANGLES);
}
virtual const core::aabbox3d<f32>& getBoundingBox() const
{
return Box;
}
virtual u32 getMaterialCount() const
{
return 1;
}
virtual video::SMaterial& getMaterial(u32 i)
{
return Material;
}
};
int main()
{
IrrlichtDevice *device = createDevice(EDT_OPENGL,
core::dimension2d<u32>(640, 480), 16, false);
if (device == 0)
return 1; // could not create selected driver.
// create engine and camera
device->setWindowCaption(L"Custom Scene Node - Irrlicht Engine Demo");
video::IVideoDriver* driver = device->getVideoDriver();
scene::ISceneManager* smgr = device->getSceneManager();
smgr->addCameraSceneNode(0, core::vector3df(0,-40,0), core::vector3df(0,0,0));
CSampleSceneNode *myNode =
new CSampleSceneNode(smgr->getRootSceneNode(), smgr, 666);
scene::ISceneNodeAnimator* anim =
smgr->createRotationAnimator(core::vector3df(0.8f, 0, 0.8f));
if(anim)
{
myNode->addAnimator(anim);
anim->drop();
anim = 0;
}
myNode->drop();
myNode = 0; // As I shouldn't refer to it again, ensure that I can't
u32 frames=0;
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,100,100,100));
smgr->drawAll();
driver->endScene();
if (++frames==100)
{
core::stringw str = L"Irrlicht Engine [";
str += driver->getName();
str += L"] FPS: ";
str += (s32)driver->getFPS();
device->setWindowCaption(str.c_str());
frames=0;
}
}
device->drop();
return 0;
}
Great patch Nadro

everything worked like a charm (tried most of examples randomly)
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Wed Mar 21, 2012 10:57 pm
by REDDemon
I found few bugs (all related to Code::blocks+mingw projects files and EDT_OPENGL as driver).. I hope to not be boring.
05 - this example simply setted as output directory "gcc" instead of "win32-gcc".
08 - Special FX example has buggy shadows (already noticed)
10 - Shaders example Cg shaders are not working at all (all the 3 cubes are identical)
16 - this example is linking with Irrlicht.lib instead of libIrrlicht.dll.a
19 - same problem as 05
21 - this example don't compile it says "main.cpp" line 1171 error: invalid conversion from 'int' to 'const wchar_t*'"
23 - same problem as 16
all other examples worked
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Wed Mar 21, 2012 11:58 pm
by Nadro
Thanks for info. What about Code::blocks+mingw projects? I use version from a trunk, so we should first fix a file project in a trunk

I have one question for example no. 10? Did You compile Irrlicht with a Cg support? Cg isn't enabled default. If not, this is a normal behaviour for this example.
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Thu Mar 22, 2012 8:36 am
by REDDemon
ah !:) thx
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Fri Mar 23, 2012 5:59 pm
by Mel
I am also testing this with the CG languaje support disabled, is it better to have it or not?
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Fri Mar 23, 2012 9:34 pm
by fmx
Depends if you want to use CG or not

I like CG, only have to write shaders once and they work regardless of driver
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Sat Mar 24, 2012 7:02 pm
by Nadro
Bug in a Demo example is fixed. Currently it looks like a FVF implementation is a bugs free.
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Sat Mar 24, 2012 7:29 pm
by serengeor
Nadro wrote:Bug in a Demo example is fixed. Currently it looks like a FVF implementation is a bugs free.
Reminds me
viewtopic.php?f=3&t=34610&start=390#p265751 
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Sat Mar 24, 2012 8:04 pm
by Nadro
Thats why I said "Currently it looks like a..."

I mean that known bugs list is now empty

I'm 99,(9)% sure that in future we'll found many bugs in FVF

Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Sun Mar 25, 2012 5:01 pm
by Mel
fmx wrote:Depends if you want to use CG or not

I like CG, only have to write shaders once and they work regardless of driver
Yes, but i was wondering if there was any kind of dependency between the FVF system and the CG system.
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Sun Mar 25, 2012 5:08 pm
by Nadro
No, there is no a dependency between a FVF and Cg.
Re: Flexible Vertex Format - special SVN branch is ready!!!
Posted: Sun Mar 25, 2012 8:35 pm
by REDDemon
is pretty stable for a so huge patch anyway.

.