Texture only showing as one color

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

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

Comments

Did you manage to solve this? If yes, how? I am currently having the same problem.

fmeccanici gravatar imagefmeccanici ( 2020-06-02 09:06:50 -0600 )edit

I also have the same issue using material scripts with STL files in Gazebo 9

nathan5802 gravatar imagenathan5802 ( 2020-06-08 15:27:06 -0600 )edit

I am also having this same issue? Has anyone managed to figure this out yet?

kumarhans gravatar imagekumarhans ( 2020-12-21 22:59:40 -0600 )edit

Are you using the same texture for normal maps and diffuse? It might be a problem. And one mistake I can find in your material script is that the code of scale 1 1 1 1 1 1

It think general format must be something like scale <uscale> <vscale>For more information try to look at https://wiki.ogre3d.org/Materials

Shravista Kashyap gravatar imageShravista Kashyap ( 2021-06-01 11:23:30 -0600 )edit