Skip to content

D2icehacker/WebGL-2.0-Dual-Cube-Shaders-with-Unified-Controls-and-Enhanced-Shading-Interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebGL 2.0 Program

This project contains a WebGL 2.0 program that displays two cubes with shared interface controls. The cubes can be rotated, and various parameters affecting shading, including light position, can be adjusted. Additionally, the projection can be toggled between parallel and perspective.

Contents

  • shaders: Folder containing vertex and fragment shaders for the cubes.
  • js: Folder containing the main JavaScript file (main.js).
  • index.html: HTML file for the web page, including Bootstrap for UI elements.
  • style.css: CSS file for styling.
  • README.md: This readme file.

Implementation Details

  • The vertex and fragment shaders combine rotations for both cubes.
  • Interface elements control rotations, light position, and shading parameters.
  • Projection can be toggled between parallel and perspective.

How to Run

  1. Open index.html in a WebGL 2.0 supported browser.
  2. Interact with the controls to see the cubes' behavior.

Acknowledgments

  • Shaders adapted from the class examples.
  • Bootstrap is used for UI elements.

Feel free to explore and modify the code to suit your needs.