When I add skeleton file, material appears funky?

Problems building or running the engine, queries about how to use features etc.
Post Reply
Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

When I add skeleton file, material appears funky?

Post by Nickak2003 »

I made a model in blender, exported with blender2ogre. The model loads in ogre and shows the material and texture perfect, until I add a skeleton file to the directory then the material appears mostly black. I've looked at the xmls and cant figure it out.
Here is with the .skeleton in the directory:
Image
Here it is when no .skeleton is present:
Image
Heres the skeleton file:

Code: Select all

<skeleton >
  <bones >
    <bone id="0" name="base" >
      <position z="0.000000" y="-2.580261" x="0.000000" />
      <rotation angle="0.000000" >
        <axis z="0.000000" y="0.000000" x="1.000000" />
      </rotation>
    </bone>
    <bone id="1" name="boneexhaust" >
      <position z="0.000000" y="2.580261" x="0.000000" />
      <rotation angle="0.031757" >
        <axis z="-0.000310" y="-0.019528" x="-0.999895" />
      </rotation>
    </bone>
  </bones>
  <bonehierarchy >
    <boneparent parent="base" bone="boneexhaust" />
  </bonehierarchy>
</skeleton>
Heres the vertex format

Code: Select all

<mesh>
    <sharedgeometry vertexcount="702">
        <vertexbuffer positions="true" colours_diffuse="False" texture_coords="1" normals="true">
            <vertex>
                <position z="0.981362" y="0.679798" x="0.000000"/>
                <normal z="0.158038" y="0.961851" x="0.223310"/>
                <texcoord u="0.815043" v="0.647575"/>
            </vertex>
Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: When I add skeleton file, material appears funky?

Post by Nickak2003 »

OK i figured it out, the problem was that blender2ogre was exporting the texture coords in buffer0, they apparenrtly need to be in buffer1 for some reason, separate from the position/normals. I modified the blender2ogre script to do this. Is blender2ogre is defunct? If anyone is interested in the modifications let me know
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: When I add skeleton file, material appears funky?

Post by Kojack »

Which version of Ogre where you doing this with? Having only 1 vertex buffer should be fine in Ogre 1.x, and skeletons shouldn't affect it.
What was the material like? Was it using a hardware skinning material? Shaders?
Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: When I add skeleton file, material appears funky?

Post by Nickak2003 »

Thanks for the response!

It is ogre 1.9. I just rebuilt everything just to check (this link, download button, https://bitbucket.org/sinbad/ogre/src/4 ... ?at=v1-9-0 ). It doesn't seem to work with one vertex buffer. Here is my material:

Code: Select all

material jetmat 
{
    receive_shadows on 

    technique
    {
        pass jetmat
        {
            ambient 1 1 1 1.0
            diffuse 1 1 1 1.0
            

            texture_unit 
            {
                texture jet1tex.png 0
                tex_address_mode wrap
                scale 1.0 1.0
                colour_op modulate
            }
        }
    }
}
However, I have noticed that both ninja and robot also have a separate uv buffer.
Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: When I add skeleton file, material appears funky?

Post by Nickak2003 »

LOL. So, I click that link, the text says 1.9, but the download is actually for 1.10 unstable... according to the cmake output which i didnt notice until recently. Ya, it wasnt 1.9, thanks!
butigy
Gnoblar
Posts: 3
Joined: Thu Dec 19, 2019 2:22 pm

Re: When I add skeleton file, material appears funky?

Post by butigy »

I had this as well (Blender 2.79, Ogre 1.12, Windows 8.1, Visual Studio 2019). I used the ogremeshupgrader with the -i option and allowed it to reorganise the mesh vertex buffers. The "automatic" option puts the texture coordinates in buffer1 instead of buffer0. From then it worked fine.
Post Reply