fabmax / physx-jni

Java JNI bindings for Nvidia PhysX
MIT License
85 stars 8 forks source link

Add support for custom filter shaders #32

Closed EddeDev closed 2 years ago

fabmax commented 2 years ago

That would indeed be quite useful. However, I think a Java passthrough of the filter shader will have pretty bad performance (the filter shader can be called an awful lot of times), so I haven't done that until now. It might be useful anyway.

fabmax commented 2 years ago

I gave it a try and it works better than expected. It's available in the current 0.4.16-SNAPSHOT release and in the dev branch.

Here is an example how to use it: PassThroughFilterShaderTest.

I tested the filter shader with 2000 colliding boxes and there is almost no difference in speed comapred to the native default filter shader.

A few notes:

EddeDev commented 2 years ago

Thanks! :D