Pixel Perfect Collision Detection...version upgrade,need help

Dear everyone!
I did some work for Pixel Perfect Collision Detection.And I find a blog to show this tech:http://blog.muditjaju.infiniteeurekas.in/?p=1
But It’s writen by cocos2dx version2,I use version3 one.So I write a same class in version3 style…but something is wrong.while I drag an object to another,the two objects’ coordinate are all mess up.I don’t know what happened.Now I upload my code:class.zip (2.5 KB) .Here u can get the whole class,and shader file.Then I will give the weird result.
The 1st is the state we I start my test:

and while they are colliding…

so who can find the problem and fix it…thks a lot…I’ll keep to try

Well…anyone can help me?

if rectA intersects rectB then this is always true:

if(rectA.getMaxX() > rectB.getMinX())

I guess it’s probably a typo and you meant rectB.getMaxX()

Thanks Ajas.It’s really a mistake,but not the key problem…

Have you tried outputting the result of the RenderTexture to the screen to see if it looks like what you expect?

Thks for your reply toojuice.I have tried to draw the RenderTexture to see what happened.And the result was not the hopeful one.While I drag one obj to the other,the RenderTexture draw the new pics in the center screen,and they are full color…not blue and red.And the original pics’ coordinates are all changed like the screenshot what I showed.
I found that if I don’t call the setGLProgram method,nothing well happened,and I know the render mechanism is modified in a new way.But I don’t know how the new render mechanism working,so I need more information about the render in cocos2dx version3

The rendering pipeline for cocos2d-x v3 now requires OpenGL calls to be wrapped in a Custom Command. Take a look at this post for an example of this. Maybe this is the issue?

Thank you very much!Let me have a try

I did have the same problem. Have you solve it yet ? Thank you so much if you can share the idea.