<commit_before># WebGL Video Questions

1) What is meant by `in`, `out`, `uniform` variable “types” in OpenGL programming?

2) In the rotating cube example, what data/parameters is passed from the main display routine (which is running in the CPU) to the GPU? How would this scale if the model is an object with millions of vertices instead of just a cube?


3) When doing lighting/illumination computations, what do they say is the key trade-off between using the vertex shader versus using the fragment shader? 

Using the fragment shader you would compute the colour per fragment (every pixel in screen), and get much finer results, but a performance penalty because there is a whole lot more fragments in the screen in comparison to the number of triangles that go with it.
<commit_msg>See #2. Solve Webgl question 4)1)<commit_after># WebGL Video Questions

> 1) What is meant by `in`, `out`, `uniform` variable “types” in OpenGL programming?

- `in` - A parameter declared as `in` means that the value given to that parameter will be copied into the parameter when the function is called. The function may then modify that parameter as they see fit, but those changes will not affect the calling code. `in` is the default qualifier if no qualifier is specified.

- `out` - A parameter declared as `out` will not have its value initialized by the caller. The function will modify the parameter, and after the function's execution is complete, the value of the parameter will be copied out into the variable that the user specified when calling the function. Note that the initial value of the parameter at the start of the function being called is undefined, just as if one had simply created a local variable.

- `inout` - The `inout` declaration combines both, `in` and `out`. The parameter's value will be initialized by the value supplied by the user, and its final value will be output

- `uniform` - Uniform variables are read-only and are shared among all processed vertices. They are used to communicate with vertex or fragment shader. They do not change from one execution of a shader program to the next within a particular rendering call.

> 2) In the rotating cube example, what data/parameters is passed from the main display routine (which is running in the CPU) to the GPU? How would this scale if the model is an object with millions of vertices instead of just a cube?


> 3) When doing lighting/illumination computations, what do they say is the key trade-off between using the vertex shader versus using the fragment shader? 

Using the fragment shader you would compute the colour per fragment (every pixel in screen), and get much finer results, but a performance penalty because there is a whole lot more fragments in the screen in comparison to the number of triangles that go with it.

{'fraction_non_alphanumeric': 0.04265908282971916, 'fraction_numerical': 0.003199431212228937, 'mean_word_length': 4.411538461538462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2088257', 'n_tokens_mistral': 666, 'n_tokens_neox': 631, 'n_words': 464}