Avoiding fragment shader processing and fragment discarding

Friday, July 4, 2014

My case is as followed: I am rendering a scene with lots of models which all have a heavy fragment shader applied. In this fragment shader I also do a discard.


The models are divided in chunks (like voxels).


At the moment I am rendering the chunks front to back with depth function GL_LESS, depthmask on. I discard parts of models when needed.


Until now, I haven't been able to find anything faster. It is commonly said that discard must best be avoided, but I can't find out a technique which will allow me to render as fast, or as precise (although I can be flexible on that).


I have tried blending with GL_DST_ALPHA without discard, but it is slow and inaccurate.


Rendering back to front is also slow.


How can I render my scene similar to my current case without discarding fragments or processing each fragment too often? Am I looking for something unreasonable and should I accept my current case?







http://ift.tt/1klIJsP