YoVDO

Grass Rendering in OpenGL - Code Review

Offered By: The Cherno via YouTube

Tags

OpenGL Courses C++ Courses Computer Graphics Courses GPU Programming Courses Shaders Courses Code Optimization Courses

Course Description

Overview

Dive into an in-depth code review video focusing on grass rendering in OpenGL. Learn about efficient object instantiation in C++, shader class implementation, variable naming conventions, and proper initialization techniques. Explore string handling, type usage, and the intricacies of the .obj format. Gain insights into grass mesh creation, rendering techniques, and C++ code style best practices. Discover optimization strategies for grass rendering, including time variable handling, storage buffer usage, and complexity reduction in hot code paths. Analyze grass vertex and fragment shaders, with tips on using mat3 instead of mat4 and adding color variance to grass blades. Utilize Nvidia Nsight for rendering inspection and learn how to optimize GPU buffer allocation for improved performance.

Syllabus

- Rendering lots of grass in OpenGL
- Diving into the code
- Instantiating objects in C++ vs C#/Java
- Shader class
- Variable naming conventions
- Initializing variables
- Some notes on strings
- Pass larger types by const reference
- Using correct types
- Strings in C++ and std::string_view
- .obj format
- Grass mesh
- Rendering meshes
- General notes and C++ code style
- Grass rendering and shaders
- Handling a time variable for shaders
- Storage buffers in OpenGL
- Reduce complexity in hot code paths
- How grass is actually rendered
- Grass vertex shader
- Use mat3 instead of mat4
- Reduce vertex shader complexity
- Don't reallocate GPU buffers
- Inspecting rendering using Nvidia Nsight
- Set buffer data instead of reallocating
- Grass fragment shader + improvements
- Adding variance to grass blade color


Taught by

The Cherno

Related Courses

Computer Graphics
University of California, San Diego via edX
Interactive Computer Graphics with WebGL
University of New Mexico via Coursera
3D Graphics in Android: Sensors and VR
Imperial College London via Coursera
Android Graphics with OpenGL ES
Imperial College London via Coursera
Advanced App Development in Android Capstone
Imperial College London via Coursera