problem with opacity change of objects

Anonymous 9 years ago 0
This discussion was imported from CodePlex

soheilvb wrote at 2012-04-14 09:22:

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

soheilvb wrote at 2012-04-14 11:10:

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 .

murray_b wrote at 2012-04-16 05:52:

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

soheilvb wrote at 2012-04-16 06:15:

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

objo wrote at 2012-04-16 21:49:

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.

soheilvb wrote at 2012-04-17 04:17:

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

tnx by the way ...

objo wrote at 2012-04-17 07:58:

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!