Another object/texture transparency problem

Started by inelokii, August 21, 2013, 03:35:13 PM

Previous topic - Next topic

inelokii

Hello everyone,

I have a annoying problem about transparency objects. I read a lot of threads in this forum, but I'm still not able to find a good solution.

My goal is to draw a character that have water under knees (not neck).
If objects are not transparent, it's easy to do that.
But I can't have a similar result with transparent objects: http://postimg.org/image/t3yf7kmjr/cfd76ffa/ (or in attachment of this topic).

Some comments about the picture :
- The ground (green and orange/brown part of the picture) is an object3D, not transparent.
- The water is one level higher than the ground. It is a set of rectangular transparent object3D, one per square. Each object has its own sort offset, depending of the location & camera angle.
- The character is an Object3D (rectangular), transparent because texture contains fully transparent pixels. Like water objects, the sort offset of this object depends on its location & camera angle (but higher than water for the same square).


I don't know how to fix this in an efficient way, because splitting each Object3D composing the water into 4 little object3D sounds an heavy solution...
On other hand, I don't know if I can modify texture of a specific object (for example, add a texture representing water on character texture).
Or if there is a way to display the texture on a non transparent object (by removing black pixels for example), I'm also interested!

Anyone have a clue for this problem? :'(

[attachment deleted by admin]

EgonOlsen

If multiple transparent objects intersect, you'll always run this kind of sorting issues. Even if you split the water planes to smaller ones, you will get incorrect sorting. Either split the cahracter object itself into one below and one above the Walter or use a real 3d model without transparency for.

inelokii

Thanks you for your advice!

I will try to split the object representing my character into 2 objects, 1 above the water, 1 below (with of course the same texture).
It will make my transparent objects organization simplier  ;D
I hope the texture "link" between the above and the below part will be nice (no "cut" texture effect)  ::)

inelokii

I have implemented the solution of having 2 Object3D, one for the bottom part (under water), the other for the upper part.

It works well, even for 2D animations (texture shifts)!
In the architecture I have done, my only regret was to have 2 instances of GenericVertexController for handling Object3D "sizes" (but one class only  :P)

In Attachment of this post a new picture of my progress  ::)!

Thanks you!

[attachment deleted by admin]

EgonOlsen