Skip to content

Instantly share code, notes, and snippets.

extends Camera
"""
Space/Enter - capture cursor
Escape - free cursor
WASDQE - move
Shift - fast movement
Ctrl - slow movement
"""
@belzecue
belzecue / Camera.gd
Created October 24, 2022 12:15 — forked from Garmelon/Camera.gd
Godot perspecive projection shaders
extends TextureRect
export var sensitivity: Vector3 = Vector3(0.005, 0.005, TAU/4)
var euler: Vector3 = Vector3.ZERO
func _init() -> void:
sensitivity.x *= -1
func _input(event: InputEvent) -> void:
if event.is_action_pressed("ui_cancel"):
@belzecue
belzecue / Uneune.shader
Created August 25, 2019 18:32 — forked from sugi-cho/Uneune.shader
頂点をいじるシェーダーで、法線もいじる
Shader "Custom/Uneune" {
Properties {
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
_BumpMap ("bump",2D) = "bump" {}
_VNF ("vert normal factor", Float) = 1.0
_MNF ("map normal factor", Float) = 1.0
}
@belzecue
belzecue / ColorRotator.cs
Last active October 12, 2022 22:13
Unity3D Tip #1: Color.HSVToRGB(h, s, v) produces smoother, more natural random colors than new Color(r, g, b)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorRotator : MonoBehaviour {
public GameObject objHSV, objPlainColor;
private Material objHSVMaterial, objPlainColorMaterial;
private float timeDelta;
@belzecue
belzecue / screenshot.gd
Created October 7, 2022 13:09 — forked from GK-GreyGhost/screenshot.gd
Create a folder in the format year-month-day and save the screenshot
func screenshot():
var img = get_viewport().get_texture().get_data()
img.flip_y()
var dir:Directory = Directory.new()
var now = OS.get_date()
var folder:String = 'user://screenshots/%s-%s-%s' % [now.year,now.month,now.day]
dir.make_dir_recursive(folder)
img.save_png(folder+'/%d.png' % OS.get_unix_time())

Google Drive Sync Wine Scripting

This is a set of scripts that help running Google Drive Backup and Sync under Wine, with multiple Google accounts.

Each account is given its own Wine prefix (a separate wine configuration).

To install, run install-gdrive-sync google_account

List the accounts set up in ~/.config/gdrive-accounts

@belzecue
belzecue / build armorpaint linux.txt
Created July 25, 2022 14:05
build armorpaint linux
How to build for Linux
Prerequisites
sudo apt install nodejs
&& sudo apt install make
&& sudo apt install clang
&& sudo apt install libxinerama-dev
&& sudo apt install libxrandr-dev
&& sudo apt install libasound2-dev
&& sudo apt install libxi-dev
shader_type canvas_item;
uniform mat4 TRANSFORM;
uniform vec2 DEPTH;
uniform bool REPEAT_X;
uniform bool REPEAT_Y;
uniform bool FLIP;
void fragment() {
// Create the matrix. A workaround is used to modify the matrix's W column
@belzecue
belzecue / RandomWallpaper.cs
Created April 2, 2022 10:55 — forked from EricJ2190/RandomWallpaper.cs
Random Windows Wallpaper
/* Selects a random image from a folder and makes it the desktop wallpaper.
* usage: RandomWallpaper.exe [c:\path\to\wallpapers]
* If the path is omitted, the current directory is used.
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
// Derived from Unity built-in shader source.
// https://raw.githubusercontent.com/chsxf/unity-built-in-shaders/0c7940740e75340009bbed453e2b198e294e4bab/Shaders/DefaultResourcesExtra/Skybox-Panoramic.shader
Shader "Skybox/Dual Panoramic" {
Properties{
_Tint1("Tint Color 1", Color) = (.5, .5, .5, .5)
_Tint2("Tint Color 2", Color) = (.5, .5, .5, .5)
[Gamma] _Exposure1("Exposure 1", Range(0, 8)) = 1.0
[Gamma] _Exposure2("Exposure 2", Range(0, 8)) = 1.0
_Rotation1("Rotation1", Range(0, 360)) = 0