Author Topic: Transparent plane and Picking  (Read 2010 times)

Offline atreyu64

  • byte
  • *
  • Posts: 44
    • View Profile
Transparent plane and Picking
« on: August 13, 2013, 12:01:19 pm »
Hi,


After my Transparent plane and Polyline overlap problem, I'm trying to pick my transparent billboards.
Picking itself seems to work well on billboards, but my concern is once more about transparency. When I pick a plane on a transparent area of its texture, it is considered as picked anyway.
This behaviour was expectable and is pretty logical, but I would need my planes not to be picked on their transparent areas.

Do you think there is a way to do it using jPCT picking methods, or I'll rather have to implement it from scratch by myself ? If so, how to check the right picked color of an object in order to check if it is completely transparent ?


Thanks in advance, regards,


Sylvain

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Transparent plane and Picking
« Reply #1 on: August 13, 2013, 07:42:45 pm »
You can't do this with the build-in picking methods. They are geometry based and they don't care about the texture. You could use build-in method in the first step and if something has been picked, you could try to read the pixel color at that point via direct GL calls...but you can only read the final color, not if there is something 'transparent' at that point.

Offline atreyu64

  • byte
  • *
  • Posts: 44
    • View Profile
Re: Transparent plane and Picking
« Reply #2 on: August 13, 2013, 11:56:03 pm »
Ok I see, maybe I'll try to make my own picking system one day but I have to learn a lot of things first...

Thanks for your answer !