Skip to content

Instantly share code, notes, and snippets.

#version 450
layout(local_size_x = 40, local_size_y = 20) in;
layout(rgba32f, binding = 0) uniform image2D imageIn;
layout(rgba32f, binding = 1) uniform image2D imageOut;
uniform float sigma;
const uint taps = 3, distToCenter = 1;
const float pi = 3.1415926535897932384626433832795, e = 2.71828;
float weights[taps];
void Timer::init(uint32_t targetRate)
{
if(targetRate <= 0) this->frameTime = 0;
else this->frameTime = MILLI / targetRate;
this->prevTime = SDL_GetTicks();
this->curTime = SDL_GetTicks();
}
void Timer::mark()
{
@izzyaxel
izzyaxel / .txt
Created September 16, 2017 03:31
cmake_minimum_required(VERSION 3.8.2)
project(projectname)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -Wpedantic")
include_directories(include)
set(SOURCE_FILES
cppfile hppfile)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
@izzyaxel
izzyaxel / BlockBlackHole.java
Created February 16, 2016 19:48
The Block for the 'black hole' type of block
public class BlockBlackHole extends BlockContainer
{
public BlockBlackHole()
{
super(Material.glass);
this.setBlockName("blackHole");
this.setHardness(1.0F);
this.setResistance(1.0F);
this.setBlockTextureName(YourModID + ":" + getUnlocalizedName().substring(5));
this.setHarvestLevel("pickaxe", 1);
@izzyaxel
izzyaxel / TEBlackHole.java
Last active June 3, 2018 19:04
The TIleEntity for a 'black hole' type of block
public class TEBlackHole extends TileEntity
{
//I use constant variables for this sort of thing
final int PULLRADIUS = 20;
final int KILLRADIUS = 3;
//Should updateEntity() be called?
@Override
public boolean canUpdate()
{
@izzyaxel
izzyaxel / AAConnectedTextureManager.java
Created September 8, 2015 01:36
Connected Texture Manager
package izzyaxel.arcaneartificing.main.helpers;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@SuppressWarnings("all")
public class AAConnectedTextureManager
{