Skip to content
generated from j-2k/WebGL-Trial

WebGL 1.0 Hello World Template Project to start graphics programming with WebGL! Renders a interpolated triangle with a bunch of boilerplate code to help with shader management & compilation!

Notifications You must be signed in to change notification settings

j-2k/WebGL-Triangle-Boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebGL Hello World - Template Project

This section is still underconstruction, this repository is generated from another repository where I learned WebGL!

Project Requirement Notes

Building the project

  1. Enter the correct directory WebGL-Trial/webgl-main
  2. Install dependencies using npm i in your terminal
  3. Run & start the project using npm run dev in terminal again
  4. The website should automatically open on localhost:5173! (Check the terminal incase its a different port! If it is taken Vite will automatically try the next available port.)

My Platform, Versioning, & Dev environment

I will list what I used, just incase for anyone wondering what I used/platform choice to make this project.

  • Mac (Sonoma 14) & Windows 10
  • Visual Studio Code / Cursor
  • npm version npm -v 10.8.2
  • node version node -v v20.17.0
  • nvm version nvm -v 0.39.0

Project Dependencies

  • Typescript
    • For obvious reasons.
  • Vite
    • Vite fixed many issues I had previously.
  • WebGL
    • Make sure your browser/machine supports WebGL!
  • Old/Previous Packages (IGNORE THIS)
    • Was using lite-server & watcher (replaced by vite).

Guide to run Typescript code locally in VSC

SKIP THIS IF YOU DONT CARE ABOUT COMPILING PURE TS CODE BY ITSELF!

  1. Pre-pre-requsite note, please if you are on windows just use a cmdprompt terminal in VSC & not powershell, for some reason powershell was auto defaulted for me & it made things worse.
  2. Pre-requsites have nodejs & npm check by doing:
    • mac/terminal > node -v && npm -v
    • windows/powershell > node -v ; npm -v
    • windows/cmdprompt > node -v && npm -v
  3. Install typescript compiler globally via npm npm install -g typescript
  4. Compile typescript code tsc filename.ts
  5. Run compiled javascript code node filename.js
    • tsc converts your TS to JS & ultimately we just run the JS file, you can do all this with just this 1 command that just merges the two together, check below:
      • mac/terminal > tsc filename.ts && node filename.js
      • windows/powershell > tsc.cmd filename.ts ; node filename.js
      • windows/cmdprompt > tsc filename.ts && node filename.js

Resources

Graphics Rendering Pipeline Process

Very important, I will write this out once I fully/almost understand everything in the pipeline.

Important Computer Graphics Concepts

This is here to list important topics & showcase some things I went through whilst learning CG & WebGL!
I want to make this clear, but im trying to learn more about CG rather than WebGL right now, since if you know CG you will adapt to any graphics specification!

Interpolated Triangle - With full refactored backend

This project was originally a learning project now refactored for a vanilla boilerplate triangle project, for me to start back again from scratch, with most things provided!

Other projects I worked on generated from this!

About

WebGL 1.0 Hello World Template Project to start graphics programming with WebGL! Renders a interpolated triangle with a bunch of boilerplate code to help with shader management & compilation!

Topics

Resources

Stars

Watchers

Forks