Skip to content

Instantly share code, notes, and snippets.

View hiulit's full-sized avatar
💻
Working

hiulit

💻
Working
View GitHub Profile
shader_type canvas_item;
render_mode blend_mix;
uniform float noiseSize : hint_range(0, 50) = 15.0;
uniform float speed : hint_range(-10.0, 10.0);
uniform float albedo : hint_range(0.0, 1.0) = 0.7;
float rand(vec2 coord) {
return fract(sin(dot(coord, vec2(35, 62)) * 1000.0) * 1000.0);
}
@cenullum
cenullum / circle.shader
Created October 18, 2020 16:30
Godot Engine Circle with Outline Color Shader
shader_type canvas_item;
uniform vec4 outline_color:hint_color = vec4(1.0,1.0,0.0,1.0);
uniform float inner_circle=0.45;
uniform float outer_circle=0.5;
const vec4 alpha_color= vec4(0,0,0,0);
uniform float smoothness=0.01;
@securas
securas / block_tileset.gd
Created August 6, 2020 15:02
A custom godot autotiler for blocks
tool
extends TileSet
const EMPTY_AUTOTILE = Vector2( 4, 0 )
var block_tiles = [ "blocks" ]
func _forward_subtile_selection(autotile_id : int, _bitmask : int, tilemap : Object, tile_location : Vector2 ):
if block_tiles.find( tile_get_name( autotile_id ) ) < 0:
@CowThing
CowThing / pixel_perfect.gd
Last active April 6, 2024 17:09
Pixel perfect scaling script for Godot 3.1
extends Node
"""
An autoload singleton for pixel perfect rendering of the game.
Set this script as an autoload.
`base_size` - Is the target size of the viewport. The viewport will scale up to fit the largest
possible integer multiple of this size within the window.
`expand` - If true the viewport will expand to the edges of the window after scaling up.
@atomius0
atomius0 / PixelPerfectScaling.gd
Created March 12, 2018 16:29
Pixel-Perfect scaling script, ported to Godot 3.
# original code by CowThing: https://github.com/godotengine/godot/issues/6506
# port to Godot 3 and bugfixes by atomius.
# usage:
# set this script as AutoLoad (Singleton enabled)
#
# in the project settings:
# [display]
# set 'window/size/width' and 'window/size/height' to your desired render resolution.
# set 'window/size/test_width' and 'window/size/test_height' to the initial window size.
@1nVitr0
1nVitr0 / autocollection.sh
Last active April 10, 2022 21:01
Shell Script for automatically creating file collections, e.g. for games
# Shell script for automatically creating file collections
# initally written to reduce the number of games when downloading
# retropie rom collections
#!/bin/bash
version="0.3.1"
collection=()
collectionname=""
collsize=0
@silverkorn
silverkorn / godot-cross-compile.sh
Last active December 30, 2020 23:26
Godot Engine cross-compiling helper attempt for Linux x11 ARM (and potentially others).
#!/usr/bin/env bash
function usage() {
echo "Usage: $(basename $0) TARGET_ARCH TARGET_OS [SCONSOPTS]"
echo "Helper to cross-compile Godot game engine [https://godotengine.org/] on other Linux architectures.".
echo
echo "The TARGET_ARCH is the target architecture/device to compile to."
echo " List of available TARGET_ARCH"
echo " rpi2"
echo " rpi3"
@damc-dev
damc-dev / menu.sh
Created May 30, 2017 13:28
Bash menu select option
#!/bin/bash
# Bash Menu Script Example
PS3='Please enter your choice: '
options=("Option 1" "Option 2" "Option 3" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Option 1")
echo "you chose choice 1"
@fm4dd
fm4dd / gcc compiler optimization for arm systems.md
Last active April 9, 2024 19:24
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@heloa-net
heloa-net / How-to.md
Created January 4, 2017 01:58
Hiding API keys on GitHub without breaking your project

Backup the API key beforehand in case you have trouble reverting the file.

Let's say the file with a key you want to hide is <filename> Open it and change the API key with a placeholder, like <api-key> Save and add the file to git and commit git commit -m 'Masking API key'

Then revert the file, undoing recent changes so your key is back where it should be and save it. Use git update-index --assume-unchanged