Texture only showing as one color

asked 2019-02-20 05:30:28 -0500

Eisenhorn gravatar image

Hello,

I was following the tutorial on colors and texutres http://gazebosim.org/tutorials?tut=co....

I am using the Ogre Material Scripts, which btw appears to work with stl files too, and there is no error that the texture cannot be loaded or what so ever. The object appears in the color sceme of the texture but thats it. Color information looks binary. I have tested different textures.

image description

The png used as a texture looks like this:

image description

When I use a grass file the object looks green.

Thats the model.sdf file:

<?xml version="1.0" ?>
<sdf version="1.5">
    <model name="BOX">

      <static>true</static>

      <link name="box_link">
        <visual name="visual">
          <meta>
            <layer>1</layer>
          </meta>
          <geometry>    
            <mesh><uri>model://BOX/materials/meshes/box.dae</uri></mesh>
          </geometry>
          <material>
            <script>
              <name>Sand/Diffuse</name>
              <uri>model://BOX/materials/scripts/gas_station.material</uri>                          
            </script>
                        <script>
              <name>Sand/Normal</name>
              <uri>model://BOX/materials/scripts/gas_station.material</uri>                          
            </script>
          </material>
        </visual>
        <collision name="collision">
          <geometry>
            <mesh><uri>model://BOX/materials/meshes/box.dae</uri></mesh>
          </geometry>
        </collision>
      </link>

    </model>
</sdf>

This is the sand.material file in the scripts folder:

material Sand/Diffuse
{
  receive_shadows off
  technique
  {
    pass
    {
      texture_unit
      {
        texture ../textures/sand.png
        scale 1 1 1 1 1 1
      }
    }
  }
}

material Sand/Specular
{
  receive_shadows off
  technique
  {
    pass
    {
      texture_unit
      {
        texture ../textures/sand.png
      }
    }
  }
}

material Sand/Normal
{
  receive_shadows off
  technique
  {
    pass
    {
      texture_unit
      {
        texture ../textures/sand.png
      }
    }
  }
}

Basically I have used the gas_station model as a template for the scripts file. Do I need serveral pngs for Normal, Specular etc. or is one script applying the texture sufficient?

I have tried different scaling factors without any visible effect. Can anybody see the mistake I am making?

Is more information required?

BR

edit retag flag offensive close merge delete