Open your .dae
file in a text editor and search for the location where the texture file is specified (e.g. tex.png
)
The surrounding lines should look something like the following
<library_images>
<image id="tex_png" name="tex_png">
<init_from>tex.png</init_from>
</image>
</library_images>
<library_effects>
<effect id="tex_png-effect">
<profile_COMMON>
<newparam sid="tex_png-surface">
<surface type="2D">
<init_from>tex_png</init_from>
</surface>
</newparam>
<newparam sid="tex_png-sampler">
<sampler2D>
<source>tex_png-surface</source>
</sampler2D>
</newparam>
<technique sid="common">
<phong>
<emission>
<color sid="emission">0.2 0.2 0.2 1</color>
</emission>
<ambient>
<color sid="ambient">0.9 0.9 0.9 1</color>
</ambient>
<specular>
<color sid="specular">0.5 0.5 0.5 1</color>
</specular>
<shininess>
<float sid="shininess">50</float>
</shininess>
<index_of_refraction>
<float sid="index_of_refraction">1</float>
</index_of_refraction>
<diffuse>
<texture texture="tex_png-sampler" texcoord="tex_png"/>
</diffuse>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
Make sure the <ambient>
tag within the <phong>
tags exist (since it seems gazebo defaults the ambient value to be some low value).
All the others are optional and can be tweaked to your own content. The values above were taken from the box_target_green
example in the gazebo models repo and seems to work good enough.
If someone knows how to set these settings from blender, do enlighten us
PS:: Please enable the use of ``` for quoting code similar to stack overflow...