Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hershwg opened this issue Sep 19, 2012 · 9 comments

Comments

@hershwg
Copy link
Member

hershwg commented Sep 19, 2012

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
Copy link
Member Author

hershwg commented Sep 19, 2012

[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
Copy link
Member Author

hershwg commented Sep 19, 2012

[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
Copy link
Member

wjwwood commented May 1, 2014

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

@wjwwood
Copy link
Member

wjwwood commented May 1, 2014

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

@wjwwood wjwwood added this to the untargeted milestone May 1, 2014
@adolfo-rt
Copy link

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
Copy link
Member

wjwwood commented May 5, 2014

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

@wjwwood
Copy link
Member

wjwwood commented May 5, 2014

@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
Copy link
Contributor

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
Copy link
Member

wjwwood commented Dec 4, 2014

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants