Is there any additional code that will be added at the begining/end of a custom VertexShader ?

edited August 2014 in GLSL / Shaders

Hello !

I would like to port a not-so-easy but great VertexShader I wrote in WebGL that allow me to make matrix transformation without using matrix at all. The code is easy for the GPU but matrix operation are ultra-heavy in Processing/Java code (the fault doesn't come from Processing/Java, it comes from how matrix work (the part we dont see when we use it) ). Actually, each matrix operation (translate/scale/rotation means 3 matrix operations) represents more than 100 calculs (300 if I apply a position & rotation & scale ) for each object, for each frame.

It's not a problem at all if you want move 50-100 objects, but it becomes one when you want to move thousands of independant objects.

I would like to know if it's possible to reproduce what I did in WebGL with Processing. Then I would like to know if a VertexShader I write in Processing is the "true" vertex shader code, or if the shader code is modified by Processing somewhere in the rendering pipeline (to use lights, for example)

Where can I find a maximum of information on Processing & Shader ? Contrary to my WebGL code, I don't want to code everything from Scratch. I would like to use everything in Processing excepted the matrix usage. Do you think it's possible ?

Thanks !

Here is my WebGL demo, each object has its own motion but don't use any matrix. (I only use the world matrix) Actually, each object contains it's own motion (compute by GPU) and a color inheritance from its parent. It should be run on google chrome for best results.

(it's just a test and it's not very user friendly : you have to put the mouse cursor on the topLeft corner, wait for the disparition then go to the bottom-right corner to get them back at the center of the screen)

http://beginfill.com/WebGL__test/

You can see the Shader code if you want (and the main source code) directly by "looking the source" of the web page.

Answers

Sign In or Register to comment.