maizensh / glfx

Automatically exported from code.google.com/p/glfx
BSD 2-Clause "Simplified" License
36 stars 10 forks source link

Techniques and passes #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
CG and HLSL are able to define multiple passes. I don't know enough about GLSL 
as I normally use CG but I believe you may intend users to use GLSL subroutines 
to accomplish this functionality. At least that is what I think subroutines are 
used for. Does this need to be implemented or am I right about the subroutines?

Original issue reported on code.google.com by ad...@ovgl.org on 6 Jan 2013 at 10:17

GoogleCodeExporter commented 9 years ago
I'm still not sure about how to implement multiple passes without intervening 
into the drawing process. Initially I built GLFX as a pre-process library, 
which means that it does its magic, and from that point onward it's all pure GL.

Personally I haven't had a chance to use subroutines, but from the looks of it 
this feature provides similar functionality to function pointers in C/C++.

If you have some ideas about these topics then lets try them.

Original comment by max.snif...@gmail.com on 6 Jan 2013 at 10:35

GoogleCodeExporter commented 9 years ago
Alright, I'll do some more research and play around a bit to see if I can get 
it work. Though my free time is about to be cut substantially as the spring 
semester starts tomorrow. It may be several month before I have enough time.

Original comment by ad...@ovgl.org on 6 Jan 2013 at 10:51

GoogleCodeExporter commented 9 years ago
Sure, no pressure. I know how demanding studies can be :)

Original comment by max.snif...@gmail.com on 6 Jan 2013 at 11:09

GoogleCodeExporter commented 9 years ago
For my own purposes I've branched glfx and added technique/pass support. The 
repo is at https://github.com/simul/glfx

Basically, passes are just programs, and a technique is a group of one or more 
programs. In DirectX C++, you explicitly invoke a draw call for each pass, and 
there's nothing to make you treat passes as being part of the same draw. But 
there's a lot of convenience in being able to group shaders this way.

Original comment by roderick...@gmail.com on 9 Oct 2014 at 1:11

GoogleCodeExporter commented 9 years ago
Thanks for the heads up Roderick. I've started going through your GitHub repo, 
and there are quite a lot of changes to go through. I'll try to merge your 
changes (or part of them) back into GLFX so that it'll have multipass support 
too (and maybe other things you made as well).

So far, with GLFX I just treated multipassing manually, but if your approach is 
non-intrusive (or minimal at most) to the drawing procedure I might have to 
reconsider.

Original comment by max.snif...@gmail.com on 9 Oct 2014 at 5:02

GoogleCodeExporter commented 9 years ago
I hope it's useful. I also made some progress with #include, but am currently 
passing source in after preprocessing #includes, with appropriate #line 
directives to get correct error lines. RewriteErrorLine then attempts to 
replace file numbers with filenames.

Original comment by roderick...@gmail.com on 9 Oct 2014 at 10:59

GoogleCodeExporter commented 9 years ago
Nice work, Roderick!

Original comment by ad...@ovgl.org on 13 Oct 2014 at 11:20