Specular Lighting in OpenGL (Followed tutorial by Michael Grieco)

Overview

Specular lighting in OpenGL

Specular Lighting in OpenGL (Followed tutorials by Michael Grieco).

2022-02-13.01-55-21.mp4

Setup

  • Clone
$ git clone https://github.com/aniketrajnish/specular-lighting-opengl.git
  • Open the solution file using VS 2014 or newer.

Changing the texture

  • Import the albedo and specular maps in the \assets folder.
  • Change the albedo and specular names in cube.hpp
Texture tex("assets/your_name.png", "material.diffuse");
Texture tex_specular("assets/your_name.png", "material.specular");

Changing the background

  • Change the RGBA values of colour buffer in the rendering loop of main.cpp
glClearColor(// your RGBA here);

Changing the properties of Cubes

Properties of cubes can be changed by making the following changes in main.cpp

  • Declaration
Cube cubes[//desired number];
  • Adding / Removing position vectors of the cubes accordingly
glm::vec3 cubePositions[] = {
    // add / remove here	
};
  • Initialization
for (unsigned int i = 0; i < //desired number; i++) {
    cubes[i] = Cube(cubePositions[i], glm::vec3(//desired size));
    cubes[i].init();    
}

Changing the properties of Lamps

Properties of lamps can be changed by making the following changes in main.cpp

  • Declaration
Lamp lamps[//desired number];
  • Adding / Removing position vectors of the lamps accordingly
glm::vec3 pointLightPositions[] = {
    // add / remove here	
};
  • Initialization
for (unsigned int i = 0; i < //desired number; i++) {
    lamps[i] = Lamp(// rgb of desired color,
    	//desired ambience, //desired diffusion, //desired specular value,
    	1.0f, 0.07f, 0.032f, // attenuation constants
    	pointLightPositions[i], //desired size;
    lamps[i].init();
}

Changing the properties of spotlight

Properties of spotlight can be changed by making the following changes in main.cpp

  • Initialization
SpotLight s = {
    Camera::cam.pos, Camera::cam.cameraFront,
    //desired inner cut off, //desired outer cut off,
    1.0f, 0.07f, 0.032f, // attenuation constants
    //desired ambience, //desired diffusion, //desired specular value
};
Owner
Aniket Rajnish
Aniket Rajnish
Diwali Lighting using ESP32 with OTA update support

OTA_ESP32_8x50_ws2811 Diwali Lighting using ESP32 with OTA update support! This code is meant to drive 8 neopixel chains through separate pins. Being

Anindya Mitra 1 Feb 5, 2022
Desk lighting with an Arduino

desk-lighting Dimmable RGB Desk Lighting with an Arduino I made a small project for my own desktop where I used: Arduino Uno A couple of LEDs A potent

Pratham 1 Apr 9, 2022
Real-Time Rendering with Lighting Grid Hierarchy I3D 2019 Demo

Real-Time Rendering with Lighting Grid Hierarchy I3D 2019 Demo Daqi Lin This demo is for the I3D 2019 paper Real-Time Rendering with Lighting Grid Hie

Lin Daqi 106 May 4, 2022
Several GX2 test programs to compare it with OpenGL. (With additional GLFW+OpenGL implementation provided)

GX2-Tests Provided are GX2 test programs and samples for comparison with OpenGL and with additional GLFW+OpenGL implementation for test on PC. These s

AboodXD 1 Nov 15, 2021
Tutorial to connect the Waveshare display ST7789V to the ESP32

ESP32-ST7789V This repository contains the required configuration to connect a display Waveshare ST7789V to an ESP32 board. The correct connection to

Pedro Paulo Amorim 1 Nov 14, 2021
A set of tutorial projects for creating a simple digital radio receiver based on the STM32G431KB microcontroller

simple-radio Обучающие проекты по созданию простого цифрового радиоприемника на базе микроконтроллера STM32G431KB. Разработка программ выполнялась в W

null 7 Apr 11, 2022
Programming tutorial series for creating LV2 plugins using C/C++ and turtle.

Programming LV2 Plugins From Scratch Programming tutorial series for creating LV2 plugins using C/C++ and turtle. Content Programming LV2 Plugins From

null 28 Apr 25, 2022
Writing a basic compiler frontend following LLVM's tutorial, with complete added supports Hindi and UTF-8 in general

सारस | SARAS Started with following LLVM's tutorial In development, a hobby project only JIT is broken right now, 'jit' branch par code hai uska Compi

Aditya Gupta 4 May 1, 2022
Implementation and tutorial for a dynamic vector data-structure in C.

Vec: A Dynamic Vector in C The subject.md file contains exercises for this implementation if you want to do it yourself. In that case, don't peek at t

Julius Koskela 30 May 4, 2022
Juce tutorial for beginners, with DSP introduction.

JUCE Tutorial Juce tutorial for beginners, with DSP basics. My teaching materials :D Warning: working in progress lesson 0: Setup lesson 1: Basic Basi

Wen-Yi Hsiao 4 Apr 14, 2022
The old Windows NT OpenGL samples/SDK from an MSDN CD.

The OpenGL API is supported on a variety of graphics hardware; the software in this release provides support for graphics hardware including basic emulation on any video adapter that is supported with the operating system, and accelerated graphics hardware that is supported by an OpenGL mini-client driver (MCD) or an OpenGL installable client driver (ICD).

Ian Hanschen 18 Jan 9, 2022
An articulating arm in OpenGL for coms336

Theodore Davis tcdavis Sean Griffen griffens opengl-articulating-arm Articulating Arm in OpenGL for ComS 336 Project Description The scene will defaul

Sean Griffen 1 Nov 16, 2021
3D Pacman with C++ and OpenGL

Pacman 3D 3D version of my Homemade Pacman, made with C++ and OpenGL Dependencies ASSIMP (to load the 3D models) and SFML (to play sounds) are needed

Lilian Mallardeau 1 Nov 21, 2021
Small Header-Only Window and OpenGL Manager.

LxDemOWin Linux Demo OpenGL and Window manager A small header-Only Window and OpenGL manager made in C, written in about 2 hours. With some basic code

PipeWarp 5 May 12, 2022
Chromium Embedded Framework with OpenGL Core or SDL2

Chromium Embedded Framework's cefsimple Off-Screen Rendering I needed to use a modifed version of cefsimple using either SDL or OpenGL Core. I tried t

Quentin Quadrat 6 Mar 17, 2022
CHIP-8 Emulator/Debugger made with C++ 17, OpenGL & ImGui.

Description (Some frames were deleted to make the GIF smaller) CHIP-8 interpreter/debugger made with C++ 17. SDL 2.0.16 for window creation, event han

Alexsander Bispo 6 Jan 7, 2022
Small Header-Only Window and OpenGL Manager.

LxDemOWin Linux Demo OpenGL and Window manager A small header-Only Window and OpenGL manager made in C, written in about 2 hours. With some basic code

pipewarp 4 Dec 11, 2021
Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.

Visualization Library 2.2 Gallery About Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on the in

Michele 286 Apr 21, 2022
A C++ binding for the OpenGL API, generated using the gl.xml specification.

glbinding is a cross-platform C++ binding for the OpenGL API. glbinding leverages C++11 features like enum classes, lambdas, and variadic templates, i

CG Internals 720 May 2, 2022