Texture only showing as one color
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.
The png used as a texture looks like this:
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
Did you manage to solve this? If yes, how? I am currently having the same problem.
I also have the same issue using material scripts with STL files in Gazebo 9
I am also having this same issue? Has anyone managed to figure this out yet?
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