-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnotes.opengl
111 lines (70 loc) · 5.05 KB
/
notes.opengl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Reading https://www.khronos.org/opengl/wiki/Shader
There are "uniform" values.
They can be statically uniform or dynamically uniform.
Shaders have access to a wide variety of resources. They can access Textures, uniforms, uniform blocks, image variables, atomic counters, shader storage buffers, and potentially other information.
https://www.khronos.org/opengl/wiki/GLSL_Object
typo: "are explicit not part of any" explicit should be explicitly
glCreateProgram() creates a program object that is still to be filled with code.
glCreateShader(..) creates a shader object.
There are Program Pipeline objects. Not quite clear what they're for yet.
https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)
There's no recursion in shader functions.
function parameters are value-return.
Keywords in, out, and inout.
https://www.khronos.org/opengl/wiki/Vertex_Shader
User-defined input values to vertex shaders are sometimes called "vertex attributes". Their values are provided by issuing a drawing command while an appropriate vertex array object is bound
Use layout qualifiers if you want to have control how they are laid out.
(Cold this be related to their arrangement in the arguments to mat in triangles-01.rkt?
https://www.khronos.org/opengl/wiki/Face_Culling
GL_CULL_FACE must first be enabled with glEnable.
To select which side will be culled, use the following function:
void glCullFace(GLenum mode);
https://www.khronos.org/opengl/wiki/Fragment_Shader
Use locatio(layout to specify he positions of the fragment output variables.
2018 01 31:
From glsltriangles there's the line
(glVertexAttribPointer 0 2 GL_FLOAT #f 0 0)
Accordint to https://web.archive.org/web/20150225192608/http://www.arcsynthesis.org/gltut/Basics/Tut01%20Following%20the%20Data.html
this means:
* 0: ???
* 2: How many values specify a single datum. In this case, two flating point values are the coordinates for a vartex.
* GL_FLOAT: The base type of the value -- 32-bit floating point
* #F: ???
* 0: the spacing between each set of values. In this cse, none.
* 0: the byte offset in the buffer of the first object. In tis case, the first obect is at the start.
WHich buffer? tha one currently bound to GL_ARRAY_BUFFER
2010 02 15
http://www.opengl-tutorial.org/beginners-tutorials/tutorial-4-a-colored-cube/
suggests very strongly that colours have to be in a different buffer from the vertices.
Not what I remembered from a while ago.
Seems unnecessarily awkward, keepint attributes so separated from the vertices.
2010 02 24
Stupid, stupid, stupid.
It seems that my questions about using openGL are answered in the Red Book and I didn't notice.
Why did I not realize to look there?
Because most of my books became inaccessible abut three years ago when I moved from a three-storey hose to a one-storey condo, and I've gotten used to doing without them and using internet sources exclusively.
So I finally ordered another copy. This is much easier thatn going into the remote storage cell and actually *finding* my own copy. The storage cell is many, many cubic metres of boxed junk. And valuable stuff, which is unfortunately mixed intimately with the junk. This whole situation makes it clear that I do have to go there and throw out the junk someday. I don't want that task to fall to the executor of my estate.
I've started reading the epub version (paper copy on the way). Epub isn't all that convenient for technical stuff, though it's just great for novels. It has no idea how to format C++ code. Or maybe my ebook screen isn't wide enough and I get too many line-wraps for the formatting to show well. And it's even worse for mathematics.
2010 03 02
My paper redbook came.
I've downloaded the source code for the examples into ~/dv/redbook/OGLPG-9th-Edition/
Within that directory, the example source code resides in src; the include files are in include, and the C++ source code for the other files the source code relies on are in lib.
In particular, LoadShaders in in lib.
Now I can start to experiment with using modern opengl directly.
2010 03 05
Had a lot of trouble with opengl in the last few days, both before and after redbook.
Yesterday I installed a new version of Racket -- the current regular release instead of the dauly build from last year.
And now all the variations on my code I was trying to see where my problems were suddently just worked.
Looks like the packages I was installing may have been suffering from version skew.
2020 03 08
I've been following the red book, rewriting their C++ examples into Racket,
and have discovered that even the simplest openGL programs there use current
features of openGL that are absent from the Racket version.
This surprised me, because the Racket binding is machine-generated from
specfiles from Khronos.
Turns out that as of June 2013 the specfiles are no longer being produced.
Instead, there's a whole new XML-based file format for this information.
So updateing the Racket binding is going to be nore substantial than just
replaceing the specfiles with new ones.
Looking into it.
This is starting to be a very different project than I originally expected.