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 / 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
@digiwombat
digiwombat / JitterFreeLit.shader
Created January 25, 2022 04:07
URP 2D Lit Smooth Pixel Scaling
Shader "Sprites/JitterFreeLit"
{
Properties
{
_MainTex("Diffuse", 2D) = "white" {}
_MaskTex("Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "bump" {}
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HideInInspector] _Color("Tint", Color) = (1,1,1,1)
@TheCuttlefish
TheCuttlefish / Look at 2D Unity
Created December 6, 2018 23:12
Look at 2D Unity (object and mouse)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LookAt2d : MonoBehaviour {
public GameObject target;
void LookAtObject () {
@TAGC
TAGC / SnakeGame.cs
Last active May 29, 2024 19:39
Basic snake game implemented in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
public static class Program
{
public static async Task Main(string[] args)
{
@acidleaf
acidleaf / vec2.h
Last active December 18, 2023 19:45
C++ 2D Vector
/*
Copyright (c) 2020 Chan Jer Shyan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: