Flexible Vertex Format - special SVN branch is ready!!!

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post 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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post 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|
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

I fixed compilation errors in a rev4113.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post 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)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post 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
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post 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.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by REDDemon »

ah !:) thx
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Mel »

I am also testing this with the CG languaje support disabled, is it better to have it or not?
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
fmx

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by fmx »

Depends if you want to use CG or not :wink:
I like CG, only have to write shaders once and they work regardless of driver
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

Bug in a Demo example is fixed. Currently it looks like a FVF implementation is a bugs free.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post 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 :lol:
Working on game: Marrbles (Currently stopped).
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

serengeor wrote:
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 :lol:
Thats why I said "Currently it looks like a..." :P I mean that known bugs list is now empty :) I'm 99,(9)% sure that in future we'll found many bugs in FVF :D
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Mel »

fmx wrote:Depends if you want to use CG or not :wink:
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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by Nadro »

No, there is no a dependency between a FVF and Cg.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: Flexible Vertex Format - special SVN branch is ready!!!

Post by REDDemon »

is pretty stable for a so huge patch anyway. :).
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Post Reply