Giter Site home page Giter Site logo

Comments (18)

heitaoflower avatar heitaoflower commented on May 28, 2024

If necessray I can upload scene files for you.

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

Please share some idea with me, just cope it once for all.

from exengine.

solenum avatar solenum commented on May 28, 2024

The only supported model format at the moment is IQM, which is a pretty bare-bones format containing only the vertex data and some material/texture ID/names. If you want to load the sponza scene, I would recommend loading it into blender, and setting the material of each mesh to the texture name.

For example, if a wall is using tex_wall_diffuse.png, you would give it a material with that name, and use the IQM expoter plugin to export the model with material names, and then make sure you store your textures in the texture folder of the engine/game data.

I agree that it's not an ideal solution, but its a pretty compact way to include meta-data like that directly in the model file. An alternative would be to do it in-engine via configs and such, or perhaps even some external level editor that allows you to load a model and apply textures to it/export it with that data.

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

Thanks for your reply.

For now, I am focusing on add material feature into iqm.

Actually my initial thoughts were to add an extra loader and parser in your iqm module, however, this way will kindly kill the idea and break the original rules of IQM.

so I would like to do some modification with it.

  1. Add a new struct of materiallib in which hold a host of material which will be referenced by mesh material idx.

  2. Add a new struct of material which defines some normal or common vars, like map_kd something like that, you know that.

  3. Add new member field material_lib into a struct of mesh, this will help this mesh to locate accurate material library later.

how do you think about this modification?

look forward to your reply.

from exengine.

solenum avatar solenum commented on May 28, 2024

I'm not sure I entirely understand to be honest, perhaps just do whatever you want with your fork and I can take a look at that before we do any pull request stuff.

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

Here is the modification commite log =>
heitaoflower/iqm@2a4032a

for now, only support obj format mesh which is reference external material config info.

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

I could able to make some minor changes after tomorrow, and organize the code.

from exengine.

solenum avatar solenum commented on May 28, 2024

Those changes appear to be for the example C++ IQM loader, right?

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

I will push later on. by the way, I wonder if you can recommend me some tools to utilize lives at ##oodnet/freenode, the way of the web is not very convenient indeed.

from exengine.

solenum avatar solenum commented on May 28, 2024

You'll need an IRC client for your OS, or use https://webchat.freenode.net/ and join the channel ##oodnet

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

I am complete the original job to load sponza scene into engine.
however the direction of the world is incorrect. do you know what is going on with it ?

image

In unity or other engines the batman as below figure:
image

in contrary the direction was incorrect as below figure in our engine:
image

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

By the way , I have upload the latest asset of sponza to the master branch .
heitaoflower@7b897ed .

besides above, would you share the original scene file with me?

from exengine.

solenum avatar solenum commented on May 28, 2024

Unity uses Z as the up-axis, I think. You'll probably just need to rotate your models -90 degrees on the X axis before exporting to fix it, or make the iqm loader swap Y and Z.

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

Thanks for your reply.

This is a snapshot of learnOpenGL demo.
image
The model always face screen outside. and also i try to fixed or copy the same camera view and proj matrix into our engine, the result is not identical.

Below configure is our engine .
image

Totally rendering by OpenGL!

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

Actually, I had tested the iqm demo with the batman mesh file, It is correct, in other words, the presentation is identical with LearnOpenDemo or another demo.

What is the unique when rendering mesh in our engine, could make an educated guess ? are there any juicy details I neglected?

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

image

Maybe this snippet code is glue.

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

glRotatef(camroll, 0, 0, 1);
glRotatef(campitch, -1, 0, 0);
glRotatef(camyaw, 0, 1, 0);
glRotatef(-90, 1, 0, 0);
glScalef(1, -1, 1);
glTranslatef(-campos.x, -campos.y, -campos.z);

The camera settings are different I see.

from exengine.

heitaoflower avatar heitaoflower commented on May 28, 2024

I think you are right, I found a snippet code as below.
epositions.add(Vec4(vkey.attrib[0] < 0 ? Vec3(0, 0, 0) : attrib[0][vkey.attrib[0]].zxy(), 1));
if (vkey.attrib[2] >= 0) enormals.add(attrib[2][vkey.attrib[2]].zxy());

the order of vertex data in iqm was zxy!!

but I have no idea why the author write like this way?

Vec3 zxy() const { return Vec3(z, x, y); }
Vec3 zyx() const { return Vec3(z, y, x); }
Vec3 yxz() const { return Vec3(y, x, z); }
Vec3 yzx() const { return Vec3(y, z, x); }
Vec3 xzy() const { return Vec3(x, z, y); }

from exengine.

solenum avatar solenum commented on May 28, 2024

Likely due to a lot of the big engines like Unity using Z as their up-axis. It's easy to fix though, either rotate -90 degrees on the X axis before exporting your model, or just swap the Y and Z when you load the model.

from exengine.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.