Skip to content

Fix mesh alpha tinting - #893

Merged
wjwwood merged 4 commits into
ros-visualization:indigo-develfrom
ellislm:fix-mesh-alpha-tinting
Jun 10, 2015
Merged

wjwwood merged 4 commits into
ros-visualization:indigo-develfrom
ellislm:fix-mesh-alpha-tinting

Conversation

@ellislm

@ellislm ellislm commented Jun 4, 2015

Copy link
Copy Markdown
Contributor

Reinstated original form of mesh tinting and removed color pass technique that was introduced in #752. The color pass technique was overriding mesh texture and alpha values. It appears that the issue present in #751 was actually a result of a piece of code that would make a mesh pure white if the message sent rgba values of 0000. I can't pinpoint why, but I estimate that somehow that was erroneously turning collada markers pure white. Tested change with rviz/src/test/mesh_marker_test.cpp and ran several tests with collada markers, using mesh_use_embedded_materials true and false. Transparency and mesh tinting appear to work as desired.

@jbohren

jbohren commented Jun 4, 2015

Copy link
Copy Markdown
Member

@Logane Can you post screenshots of the two tests?

@ellislm

ellislm commented Jun 8, 2015

Copy link
Copy Markdown
Contributor Author

Here are attached images of a mesh marker test, and a test involved collada markers with different colors and transparencies.
collada

meshtransp

@wjwwood

wjwwood commented Jun 9, 2015

Copy link
Copy Markdown
Member

@Logane thanks for the contribution, I've reviewed the code and it seems to make sense to me.

@jbohren I'm guessing you '+1' this pr since you closed yours?

@hersh if you have a spare moment, can you look at the results of this pr and give your opinion.

If @hersh and @jbohren give positive feedback, I'll merge this and work it into the next release of indigo and jade.

@hersh

hersh commented Jun 9, 2015

Copy link
Copy Markdown
Contributor

@Logane thanks for working on this.

I ran it myself and got a matching image to the white/red/pink image above. However looking at the screenshot from the original version:

image

you can see there is a normal-colored (white with black decorations) copy of the mesh off to the left side. That is the rgba=0,0,0,0 version. That was added as a special case as @Logane mentioned.

The special case is to make mesh markers visible which have uninitialized color values.

When I originally added the mesh-tinting code, mesh markers completely ignored the color value. Therefore everyone who used mesh markers just left the color unset (0,0,0,0). I added the special case to make all those uses still work.

I don't actually know what code may be out there counting on the special case. Maybe there are none. Maybe a lot.

If it's as easy as just adding back a single "if" block like "if color==0,0,0,0 { color = 1,1,1,1; }" then I would say please do it. If that breaks the collada colors, then I'm not sure what to do. Probably then we try it without the special case and see if anyone complains. :-/

@wjwwood

wjwwood commented Jun 9, 2015

Copy link
Copy Markdown
Member

@hersh I can make an announcement about it on ros-users, that way at least some affected people could be notified.

@jbohren

jbohren commented Jun 10, 2015

Copy link
Copy Markdown
Member

@wjwwood I'll defer to @hersh on this one, but this PR does satisfy my mesh-transparency use cases.

@ellislm

ellislm commented Jun 10, 2015

Copy link
Copy Markdown
Contributor Author

@wjwwood I have no objections to putting that transparency fail-safe code back in and giving it a quick test. If it fails we'll leave it out. If it works I'll update the PR. I'll look at it first thing tomorrow.

@wjwwood

wjwwood commented Jun 10, 2015

Copy link
Copy Markdown
Member

Ok, thanks @Logane.

@ellislm

ellislm commented Jun 10, 2015

Copy link
Copy Markdown
Contributor Author

@wjwwood I reinserted the line of code that forces opacity and color on mesh markers with nul rgba values. I have attached images from my testing that shows all markers appear as desired.
meshmarknew
colladanew

@wjwwood

wjwwood commented Jun 10, 2015

Copy link
Copy Markdown
Member

Looks like we have an additional pr2 base in the first image, which seems to line up with the original version. @hersh I still haven't had the time to really figure out what we should be looking for here, if you have time I'll defer to your opinion on the results.

@hersh

hersh commented Jun 10, 2015

Copy link
Copy Markdown
Contributor

I am happy with the test image showing the additional PR2 base (the one with color=0,0,0,0). The other image I have just the concern that in #752 the new image looked like this:

image

Since I don't know what was done to generate the two images, I'm not sure if the new one (with all-black, all-red, and all-blue) is correct but coming from a different source, or if it is incorrect.

@Logane do you know if you are using the same marker source for the black/red/blue image as @brindza used on #752?

@ellislm

ellislm commented Jun 10, 2015

Copy link
Copy Markdown
Contributor Author

@hersh I was using @brindza's repo for collada markers, however I had been tinkering with the meshes themselves, hence the difference. I just recloned the original, unmodified version and the textures are indeed present on the bases. There is no texture specified in the arrow dae file, so it is only the color specified by the rgba that is displayed, not the tri-color as shown above. I'm not sure if this is due to a change in the tri-arrow dae, or if this is working as-advertised.

@ellislm

ellislm commented Jun 10, 2015

Copy link
Copy Markdown
Contributor Author

Inadvertently left out depth-write argument in the previously added rgba "forced color and opacity" if statement. Created a slight anomaly with those objects. Tri-arrow object and all others were unaffected. Amended the code.

@hersh

hersh commented Jun 10, 2015

Copy link
Copy Markdown
Contributor

@Logane if you get the tri-colored arrows and the textured PR2 bases, then this change looks good to me.

@wjwwood

wjwwood commented Jun 10, 2015

Copy link
Copy Markdown
Member

Great I'll merge it as a bug fix and mark it for forward porting to Jade.

wjwwood added a commit that referenced this pull request Jun 10, 2015
@wjwwood
wjwwood merged commit 5640862 into ros-visualization:indigo-devel Jun 10, 2015
@wjwwood

wjwwood commented Jun 10, 2015

Copy link
Copy Markdown
Member

Thanks for the work guys!

DLu pushed a commit to DLu/rviz that referenced this pull request Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants