Author Topic: Another object/texture transparency problem  (Read 2633 times)

Offline inelokii

  • byte
  • *
  • Posts: 6
    • View Profile
Another object/texture transparency problem
« on: August 21, 2013, 03:35:13 pm »
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]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Another object/texture transparency problem
« Reply #1 on: August 22, 2013, 03:15:10 pm »
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.

Offline inelokii

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Another object/texture transparency problem
« Reply #2 on: August 23, 2013, 12:16:32 pm »
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)  ::)

Offline inelokii

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Another object/texture transparency problem
« Reply #3 on: August 25, 2013, 09:06:49 pm »
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]

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Another object/texture transparency problem
« Reply #4 on: August 26, 2013, 08:42:56 pm »
Looks nice... ;)