Main | API | WebRender | assignSBOPixelShader

Function

assignSBOPixelShader(sbo, filepath, functionName);

Connects the shader with the function serving as pixel shader.

Parameters

sbo - [Unsigned Integer]

The id of the shader program this is effecting. The id was provided by getSBOId.

filepath - [String]

This is the filepath relative to the webrender.js file. While this is mandatory, it is only used when rendering using threads in order to tell WebRender what files need to be loaded into the threads it creates.

functionName - [String]

The name of the function that is serving as pixel shader. This is a string name and NOT a function reference.

Return

None.

Description

This function simply connects a shader program to the function that is acting as pixel shader. The reason we pass the name of the function as a string instead of as a reference is because the shader code is generated from text, therefore a reference would be useless. It would also be useless to pass a reference when working with threads as each thread has it's own copy of the function.

See more detailed information about shaders here.

See more detailed information about multi-threading here.

Additional Notes

None.