ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
794 stars 459 forks source link

Textures appear darker than they should in rviz (missing gamma correction?) (ros-pkg ticket #5491) #515

Open hershwg opened 11 years ago

hershwg commented 11 years ago

Displaying assets with color map specification produces textures that appear darker than they should. I've compared the rviz output with that of many oter visualizers (Blender, Rhino3D, AssimpView), and in particular with Gazebo, which also has an Ogre3D backend. All other visualizers display textures properly.

My guess is that gamma correction is not being properly applied to the color map. Standard monitor correction is 2.2, and if I apply it manually to the texture, it displays properly (or at least I cannot tell if something else is wrong).

As demonstrator, I attach screenshots of the default behavior when displaying the PR2 in Gazebo (OK) and rviz (dark). I then applied a 2.2 gamma correction to the upper arm (new color map also attached to issue), and took another pair of screenshots. In this case the Gazebo render looks washed out, but rviz looks good.

Tested on the PR2 Collada files and on another (yet unpublished) Collada-based robot model. Using ROS Electric's rviz. Untested in trunk. However, the changelog since Electric does not seem to reflect improvements along these lines.

trac data:

hershwg commented 11 years ago

[hersh] Thanks for the bug report. I have also noticed that the shading of PR2 in RViz does not look as good (smooth) as that in Gazebo. I'll work on this when I get a chance.

hershwg commented 11 years ago

[adolforodriguez] Indeed shading quality is different, but just to make sure that we're on the same page, this issue is only concerned with color maps being darker everywhere, independent of shading and light source direction. There is indeed a shading issue, which (I believe) is orthogonal to dark color maps, which I've reported separately in Issue #5492.

Some details about gamma correction and Ogre3D can be found in [1]. The last paragraph of the texture section seems relevant and might help track down this issue. I haven't yet dug into the rviz internals, but I'll report back if I find something useful.

[1] http://www.ogre3d.org/docs/manual/manual_17.html#SEC81

wjwwood commented 10 years ago

@adolfo-rt do you think this is still valid?

wjwwood commented 10 years ago

Images from trac:

pr2_gazebo

pr2_rviz_default

pr2_gazebo_gamma_corrected_upper_arm

pr2_rviz_gamma_corrected_upper_arm

tiff:

http://imgur.com/nWmQ10u

adolfo-rt commented 10 years ago

The issue is still present in rviz 1.10.15, compiled against OGRE version 1.7.4 (Hydro).

The below image shows the REEM model in Gazebo 1.9.3 (left) and rviz 1.10.15 (right). The model is gamma-corrected to displays well in rviz (hence washed out in Gazebo). This compensation should be unnecessary, as other viewers like Meshlab, Assimpview, and 3DS max display the model correctly without it.

reem_gazebo_rviz

You should be able to reproduce this with the PR2 model as well, as was done in the OP.

wjwwood commented 10 years ago

Maybe I can convince one of our Gazebo/Ogre gurus to take a look at this.

wjwwood commented 10 years ago

@nkoenig, do you have any idea about this off the top of your head? No need to spend any real time on it, but even a lead or pointer to how Gazebo handles this would be useful.

gavanderhoorn commented 9 years ago

Friendly bump.

I've been looking into converting some of our models here to Collada (from STLs) but couldn't figure out proper material settings. 'Normal' colours in Blender result in washed out colours in RViz, and darker colours for RViz don't seem right in other viewers.

wjwwood commented 9 years ago

@gavanderhoorn I haven't had time to look at this further and I doubt I will in the near future. If you find any new information please let us know.