problem with opacity change of objects

Apr 14, 2012 at 8:22 AM

hi .

i am using lot's of models that overlap a lot. when i change opacity of a model the models behind that model just don't refresh ....

i use a method to remove the model and add it again to viewport3d and that somehow do the trick . but there's a lot of problem with this ...

isn't any method to just refresh the viewport ?

tnx a lot

Apr 14, 2012 at 10:10 AM

i'm pretty sure the problem is when to add models to viewport3d. models that are added after the model that it's opacity has changed have problems.

but the models that are added before are ok with opacity and ... .

i mean the arrange in viewport3d.children is important.

so when i remove the model with opacity change and add it again to viewport . everything is fine . until in some point i want to change another model opacity and remove and add that again and that gets messy ...

i don't test it with Viewport3d and just tested it with Helixviewport3d .

Apr 16, 2012 at 4:52 AM

It sounds like your problem is to do with WPF transparency being determined by the order of the objects

See this article

I hope that helps

Apr 16, 2012 at 5:15 AM

yes . the problem is z order .

my problem is a little complicated because i may have thousand transplant models that have intersections . then the simple remove add and remove won't solve it .the problem is managing lot's of transplant objects that have overlap ...

i wanna use Emissive Material but that has a lot of problems and ...

Apr 16, 2012 at 8:49 PM

It is hard to get around this with wpf 3D, unless you have a single transparent object. See the TransparencyDemo (using the HelixToolkit.SortingVisual3D) which demonstrates sorting within the limitations of wpf 3D.

To create renderings with transparent objects you can export the wpf model to an .obj file, and render in a package like Octane. See the ExportDemo, which will even start the renderer for you.

Apr 17, 2012 at 3:17 AM

i have used SortingVisual3D. that's extremely slow and produce really strange results ...

tnx by the way ...

Apr 17, 2012 at 6:58 AM

Let us know if you find a bug or improvement to the code - I think it is quite limited what is currently possible to do with wpf 3d. The demo application shows what the SortingVisual3D can do, but it can of course not handle complex models.

Consider using directx/opengl and other techniques such as depth peeling!