Skip to content

Instantly share code, notes, and snippets.

View justcore69's full-sized avatar
👀
Looking for ideas

Andrey justcore69

👀
Looking for ideas
View GitHub Profile
@justcore69
justcore69 / dec_to_base.py
Created March 18, 2024 03:05
Python function for converting decimal numbers to numbers of any base
# maximum base - 36
def dec_to_base(a, b):
sym='0123456789abcdefghijklmnopqrstuvwxyz'
s=''
while a > 0:
s += sym[a%b]
a//=b
s=s[::-1]
return s
@justcore69
justcore69 / ShadowCaster2DCreator.cs
Created October 11, 2023 14:37
ShadowCaster2D Auto creator for tilemaps by Invertex
using System.Linq;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering.Universal;
#if UNITY_EDITOR
@justcore69
justcore69 / FullscreenShaderFeature.cs
Created August 7, 2023 21:04
Scriptable Renderer Feature that applies a material to a whole screen
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class FullscreenShaderFeature : ScriptableRendererFeature
{
[SerializeField]
private Material material;
class CustomRenderPass : ScriptableRenderPass
@justcore69
justcore69 / shader-loader.cpp
Last active October 27, 2023 10:10
Function that loads OpenGL shader program from .vert and .frag files
#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
#include<glad/glad.h>
#include<GLFW/glfw3.h>
// Example: GLuint program = loadShader("src/shaders/vertexShader.vert", "src/shaders/fragmentShader.frag");
GLuint loadShader(const char* vertex_path, const char* fragment_path) { // Returns OpenGL shaderProgram