WebGL und Phong Beleuchtungsmodell
33 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Ein 8-Bit Farbbild mit Farbtabelle kann maximal 256 verschiedene Farben darstellen.

True (A)

Welche der folgenden Aussagen über WebGL sind korrekt? (Wähle alle, die zutreffen)

  • Der Befehl `wglTranslate(x, y, z)` verschiebt einen Vertex an die Stelle (x, y, z)^T.
  • Der fragment Shader wird immer vor dem vertex Shader ausgeführt.
  • Shader Programme sind Teil der graphics pipeline. (correct)
  • Shader Programme werden auf der CPU interpretiert.
  • WebGL stellt native nur einfache Primitive, wie Quadrate, Kugeln etc. zur Verfügung.
  • Das Phong Beleuchtungsmodell berücksichtigt die ______ einer Lichtquelle.

    Richtung

    Erkläre den Unterschied zwischen dem diffusen und dem spiegelnden Lichtanteil im Phong Beleuchtungsmodell.

    <p>Der diffuse Lichtanteil ist ein weiches, gerichtetes Licht, das von einer Oberfläche in alle Richtungen reflektiert wird. Der spiegelnde Lichtanteil ist ein helles, punktförmiges Licht, das in einer einzigen Richtung reflektiert wird, die durch die Oberflächennormalen und den Blickwinkel bestimmt wird.</p> Signup and view all the answers

    Verbinde die folgenden Komponenten des menschlichen Auges mit ihrer Beschreibung:

    <p>Retina = Der Teil des Auges, der die Lichtinformationen in elektrische Signale umwandelt. Sehnerv = Der Nerv, der die Signale von der Retina zum Gehirn transportiert. Linsen = Der Teil des Auges, der das Licht bündelt und auf die Retina fokussiert. Hornhaut = Die äußere, klare Schutzschicht des Auges.</p> Signup and view all the answers

    Alle Transformationen, die auf Vertices angewandt werden, müssen auch auf die Normalen (Vektoren) angewandt werden.

    <p>False (B)</p> Signup and view all the answers

    Welche der folgenden Aussagen über die Netzhaut (Retina) sind korrekt? (Wähle alle, die zutreffen)

    <p>Die Netzhaut ist für das Farbsehen verantwortlich. (A), Die Netzhaut ist für das periphere Sehen verantwortlich. (B), Die Netzhaut ist der Ort, an dem der Sehnerv das Auge verlässt. (C), Die Netzhaut enthält Zellen, die Licht in elektrische Signale umwandeln. (D), Die Netzhaut ist eine dünne Gewebeschicht, die die Rückseite des Auges auskleidet. (E)</p> Signup and view all the answers

    Was ist der blinde Fleck?

    <p>Der blinde Fleck ist der Bereich auf der Netzhaut, an dem der Sehnerv das Auge verlässt. In diesem Bereich befinden sich keine Lichtrezeptoren, daher können wir an dieser Stelle keine Informationen über Farben, Formen oder Licht wahrnehmen.</p> Signup and view all the answers

    What is the purpose of the gl.generateMipmap(gl.TEXTURE_2D); function in the provided JavaScript code?

    <p>It creates multiple levels of detail for the texture, improving performance for objects at different distances. (D)</p> Signup and view all the answers

    In the provided WebGL code, the line gl.activeTexture(gl.TEXTURE0); indicates that we are activating texture unit ______ for use.

    <p>0</p> Signup and view all the answers

    In the given GLSL fragment shader code, the output color is simply the sum of the colors sampled from the two textures u_image0 and u_image1.

    <p>True (A)</p> Signup and view all the answers

    Describe the purpose of the m4.translation() function in the code snippet for creating multiple objects in a circle.

    <p>The <code>m4.translation()</code> function calculates a translation matrix that moves an object along the specified x, y, and z coordinates. In the context of creating a circle, it is used to position each object at a different point on the circle's circumference.</p> Signup and view all the answers

    Match the following WebGL functions with their corresponding descriptions:

    <p>gl.bindTexture(gl.TEXTURE_2D, texture); = Associates a texture object with the current texture unit. gl.activeTexture(gl.TEXTURE0); = Selects a specific texture unit for active operations. gl.texImage2D(gl.TEXTURE_2D, mip, internal format, format, type, image); = Loads texture data from an image into a texture object. gl.generateMipmap(gl.TEXTURE_2D); = Creates multiple levels of detail for the texture, improving performance for objects at different distances.</p> Signup and view all the answers

    What is the purpose of the uniform variable 'u_resolution' in the vertex shader?

    <p>To transform vertex coordinates into clip space coordinates (C)</p> Signup and view all the answers

    The fragment shader is responsible for determining the color of individual pixels.

    <p>True (A)</p> Signup and view all the answers

    What does the variable 'rotationMatrix' in the JavaScript code represent?

    <p>A matrix used for rotating vertices by 180 degrees</p> Signup and view all the answers

    In the vertex shader, the function gl_Position is used to set the __________ of the vertex in clip space.

    <p>position</p> Signup and view all the answers

    Match the following shader types with their primary function:

    <p>Vertex Shader = Transforms vertex coordinates Fragment Shader = Defines pixel colors Minimalist Vertex Shader = Sets vertex position directly Rotation Matrix = Applies geometric transformations</p> Signup and view all the answers

    What is the purpose of the 'u_matrix' uniform in the vertex shader?

    <p>To transform the vertex position (D)</p> Signup and view all the answers

    The 'fov' variable determines the positioning of the camera in 3D space.

    <p>False (B)</p> Signup and view all the answers

    What is the primary function of the 'm4.perspective' method?

    <p>To create a perspective projection matrix.</p> Signup and view all the answers

    The variable 'aspect' is calculated by dividing the ______ width by its height.

    <p>canvas</p> Signup and view all the answers

    Match the following matrix operations with their purposes:

    <p>m3.translation = Moves an object in 3D space m3.rotation = Rotates an object around an axis m4.multiply = Combines multiple transformation matrices m4.inverse = Reverses the effect of a transformation</p> Signup and view all the answers

    What does the variable u_surfaceToLight represent in the vertex shader?

    <p>The position of the light source relative to the surface (A)</p> Signup and view all the answers

    The precision of floating-point values in fragment shaders can be set using 'precision highp float';

    <p>True (A)</p> Signup and view all the answers

    What operation is performed to calculate the specular reflection in the fragment shader?

    <p>The dot product is used to calculate the light reflection using half-vector normalization.</p> Signup and view all the answers

    In the fragment shader, the variable u_shiness is used to determine the ______ of the surface.

    <p>shininess</p> Signup and view all the answers

    Match the following OpenGL terms with their description:

    <p>gl_Position = The position of a vertex in clip space u_model = Transformation matrix for object-space to world-space u_modelViewProjection = Concatenated matrix for vertex transformation outColor = Final color output from the fragment shader</p> Signup and view all the answers

    Which of the following statements is true regarding the use of textures in shaders?

    <p>Textures can be bound to a unit and accessed using texture coordinates. (C)</p> Signup and view all the answers

    Vertex shaders are responsible for outputting the final color of pixels.

    <p>False (B)</p> Signup and view all the answers

    What is the purpose of the 'in' qualifier in shaders?

    <p>'in' is used to define input variables for either vertex or fragment shaders.</p> Signup and view all the answers

    The variable v_normal is used to store the ______ vector for lighting calculations.

    <p>normal</p> Signup and view all the answers

    What does the texture() function do in the fragment shader?

    <p>It retrieves a color value from a texture using texture coordinates. (D)</p> Signup and view all the answers

    Flashcards

    Grautöne im RGB-Farbwürfel

    Alle Grautöne liegen nicht auf einer Kante des RGB-Farbwürfels.

    Maximale Farben in Vollfarbbildern

    Ein Vollfarbbild kann maximal 256^3 verschiedene Farben enthalten.

    Farbtabelle eines 8-Bit Bildes

    Ein 8-Bit Bild mit Farbtabelle kann maximal 256 Farben darstellen.

    Fragment Shader Ausführung

    Der Fragment Shader wird immer nach dem Vertex Shader ausgeführt.

    Signup and view all the flashcards

    Graphics Pipeline und Shader Programme

    Shader Programme sind Teil der Graphics Pipeline.

    Signup and view all the flashcards

    Phong Beleuchtungsmodell und Lichtquelle

    Das Phong Beleuchtungsmodell berücksichtigt nicht die Größe einer Lichtquelle.

    Signup and view all the flashcards

    Diffuses Licht und Flächennormalen

    Beim diffusen Lichtanteil haben alle Lichtstrahlen den gleichen Winkel zur Flächennormalen.

    Signup and view all the flashcards

    Skalarprodukt von Vektoren

    Das Skalarprodukt liefert nicht den Winkel zwischen zwei Vektoren.

    Signup and view all the flashcards

    Translation Matrix

    A matrix that moves an object's position in 3D space.

    Signup and view all the flashcards

    Rotation Matrix

    A matrix that rotates an object around an axis.

    Signup and view all the flashcards

    Perspective Camera

    A camera setup that simulates depth and field of view in 3D graphics.

    Signup and view all the flashcards

    View Projection Matrix

    Combines projection and view transformations for rendering 3D scenes.

    Signup and view all the flashcards

    Vertex Shader

    A program that processes each vertex's data and transformations before rendering.

    Signup and view all the flashcards

    Vertex Shader Conversion

    Transforms coordinates into Clip Space coordinates in WebGL.

    Signup and view all the flashcards

    Creating a Buffer

    Establishes a buffer to store graphical data in memory for WebGL.

    Signup and view all the flashcards

    Fragment Shader Colors

    Defines the color output of fragments in a WebGL program.

    Signup and view all the flashcards

    Rotation Matrix in Shaders

    Matrix used in shaders to rotate objects, such as by 180 degrees.

    Signup and view all the flashcards

    3D Object Shader

    A shader that applies transformations to 3D object vertices.

    Signup and view all the flashcards

    Fragment Shader

    A program that computes the final color of pixels.

    Signup and view all the flashcards

    Uniform Variables

    Global variables used in shaders that remain constant within a draw call.

    Signup and view all the flashcards

    Light Direction Vector

    A vector that points from the surface to the light source.

    Signup and view all the flashcards

    Normal Vector

    A vector perpendicular to the surface at a point, influencing lighting calculations.

    Signup and view all the flashcards

    Texture Coordinates

    Mapping coordinates used to define how textures wrap around 3D geometry.

    Signup and view all the flashcards

    Specular Reflection

    The mirrored reflection of light off a surface, creating highlights.

    Signup and view all the flashcards

    Diffuse Reflection

    Scattering of light in many directions from a rough surface.

    Signup and view all the flashcards

    Model-View-Projection Matrix

    Matrix used to project 3D coordinates onto 2D screen space.

    Signup and view all the flashcards

    Shininess Parameter

    Controls the size and intensity of specular highlights in shading.

    Signup and view all the flashcards

    texImage2D function

    A WebGL function to specify a two-dimensional texture image.

    Signup and view all the flashcards

    Active Texture Unit

    A WebGL context state that determines which texture is bound for rendering.

    Signup and view all the flashcards

    Mipmap Generation

    A technique that creates multiple levels of detail for textures, improving rendering.

    Signup and view all the flashcards

    Matrix Transformations

    Mathematical operations applied to objects to manipulate their position and orientation in 3D space.

    Signup and view all the flashcards

    Study Notes

    • No specific content provided for study notes.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    VIM Klausur SS2024 PDF
    Coding 26 April 2023 PDF

    Description

    Dieser Quiz behandelt grundlegende Konzepte von WebGL und das Phong Beleuchtungsmodell, einschließlich der Eigenschaften von Lichtquellen und der Netzhaut im menschlichen Auge. Teste dein Wissen über Farben, Lichtanteile und die Funktionsweise des menschlichen Sehens. Beantworte Fragen zu Transformationen von Vertices und Normalen.

    Use Quizgecko on...
    Browser
    Browser