Skip to content

Instantly share code, notes, and snippets.

View prankush-tech's full-sized avatar
🐉
Training in hyperbolic time chamber

Prankush Giri prankush-tech

🐉
Training in hyperbolic time chamber
View GitHub Profile
@prankush-tech
prankush-tech / GLSL-Noise.md
Created November 23, 2024 11:36 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@prankush-tech
prankush-tech / Lights.glsl
Created September 5, 2024 23:28
In GLSL, **point light** emits light from a specific position in all directions with intensity decreasing over distance. **Directional light** has no position, shining uniformly from a direction. **Ambient light** provides constant, non-directional lighting to simulate global illumination.
vec3 pointLight(vec3 lightColor, float lightIntensity, vec3 normal, vec3 lightPosition, vec3 viewDirection, float specularPower, vec3 position, float lightDecay)
{
vec3 lightDelta = lightPosition - position;
float lightDistance = length(lightDelta);
vec3 lightDirection = normalize(lightDelta);
vec3 lightReflection = reflect(- lightDirection, normal);
// Shading
float shading = dot(normal, lightDirection);
shading = max(0.0, shading);
import { initializeApp } from 'firebase/app';
import { getFirestore, doc, getDoc, setDoc } from 'firebase/firestore';
import { getAuth, signInWithRedirect, signInWithPopup, GoogleAuthProvider, createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut, onAuthStateChanged } from 'firebase/auth';
const firebaseConfig = {
apiKey: '',
authDomain: '',
projectId: '',
storageBucket: '',
messagingSenderId: '',
import java.util.*;
class sum {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while(t-- >0)
{
System.out.println("Hello, World!");
}
@prankush-tech
prankush-tech / index.html
Created August 11, 2022 07:41
A simple HOME ABOUT CONTACT ME / Local HOST server
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HOME PAGE</title>
</head>