OpenGL function for plotting images to given location
This project entails writing a function that draws using OpenGL(ES) to an FBO that can be retrieved and stored for later usage. The function needs to handle both iOS and Android JNI in C++ with reusable code (can do a simple #ifdef around small sections as needed, e.g. to create context) but majority of code should be identical across platforms.
Essentially it is a super simple function to draw sprites given certain parameters. This project has to be developed custom for this job and not use a library. It must run as fast as possible as the end project will be rendering 5000+ of these plot points at any given interval with output image size up to the max texture size for any given device. (Requiring that the function be called multiple times so that it can continue where it left off)
Requirements are C++, Android 4.0+, iOS 7+. Android and iOS platform specific usage should be kept to a minimum and Objective C or Java used sparingly (i.e. to retrieve native context)
OpenGL ES 2.0+ and equivalent on Desktop (if bid). This means NPOT are acceptable and preferred.
(Textures can be sent in using a texture sheet if this will speed up rendering, prefer them as separate. If done as 1 sheet just setup parameters to describe the textures on the sheet. Also if done as a sheet it must handle near max texture size for sheet.)
void * pixels;
//can be as large as 500X500 or similar
float x;//given in coordinate system of function
float width;//given in coordinate system of function
float orientation; //radians
float opacity;//overall how see-through is this plot point.
int whichTexture; //points to the texture in the first list
//it is acceptable if the PlotPoint describes a squished texture. Aspect is decided by PlotPoint not by texture being passed in.
void PlotPoints(vector<Texture> textureList, vector<PlotPoint> pointList, int imageWidth, int imageHeight, bool createNew, bool finalize)
//if createNew is on then the FBO should be created and set to transparent black..otherwise this will reuse the FBO and continue where the last call left off
//x,y of plot point should be within bounds, however adding into scale/rotation the bounding box may not be within bounds given.
this function will take and draw the textures given by the list of PlotPoints in full color based on the original texture color.
//if finalize is true then.
//finalized FBO image will be left here for our team to work with and pulled down off the GPU into a char * or RGBA Bytes with rowBytes set.
//finalized FBO should be transparent except where Plot Points are rendered
void PlotColorPoints(vector<Texture> textureList, vector<PlotPoint> pointList, int width, int height, bool createNew, bool finalize)
same as above but instead of taking a full color texture it will take a gray texture and merge the given color in the PlotPoint. Basically using the grayScale as alpha strength. MergeWithColor
Both functions need to fully handle alpha compositing and order in the list. If a texture is semi-transparent to begin with, or given an opacity value less than 1.0 it needs to be merged into the image.
Both functions also need to expose the fragment shader so our team can go in and tweak the processing before the final gl_FragColor is set on the screen.
The project should be included for test case and able to be compiled and run as-is. However test case code is not critical. Test code could just save the image, etc.
Ideally the candidate will also provide code that works on Windows and MacOS of the same function. If you are able to do this then make notes in bid.
All rights to end job will be retained by our team and there must not be any copyrightable code included in final work.
This is an asap job and candidate will be chosen based on price and time to completion.