Skip to content

Instantly share code, notes, and snippets.

@torcado194
torcado194 / cleanEdge-shadertoy.glsl
Last active May 31, 2024 11:23
cleanEdge, a pixel art upscaling algorithm for clean rotations
/*** MIT LICENSE
Copyright (c) 2022 torcado
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
@SorenSaket
SorenSaket / main.odin
Last active July 19, 2024 12:19
GLFW, OpenGL Window Tutorial in Odin language
// GLFW and OpenGL example with very verbose comments and links to documentation for learning
// By Soren Saket
// semi-colons ; are not requied in odin
//
// Every Odin script belongs to a package
// Define the package with the package [packageName] statement
// The main package name is reserved for the program entry point package
// You cannot have two different packages in the same directory
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 26, 2024 01:53
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

WARNING: coremods are present:
offlineskins (OfflineSkins-1.12.2-v4-core.jar)
McLib core mod (00004375-2019-04-21.jar)
LittlePatchingLoader (00004373-2019-04-21.jar)
BlockbusterCore (00004355-2019-05-05.jar)
SecretRoomsMod-Core (00004384-2019-04-21.jar)
CTMCorePlugin (00004358-2019-04-21.jar)
CreativePatchingLoader (00004357-2019-04-21.jar)
ForgelinPlugin (00004365-2019-04-21.jar)
offlineskins (00004379-2019-04-21.jar)
@Cadiboo
Cadiboo / ClientEventSubscriber 1.12.2.java
Last active May 20, 2019 02:28
Cache Rendering Blocks in RenderWorldLastEvent
package io.github.cadiboo.testing.client;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BlockRendererDispatcher;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RegionRenderCacheBuilder;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.renderer.vertex.VertexFormat;
@happyzleaf
happyzleaf / build.gradle
Created December 11, 2018 11:00
Forge Mixins
buildscript {
repositories {
jcenter()
maven {
name = 'forge'
url = 'https://files.minecraftforge.net/maven'
}
maven {
url = 'http://repo.spongepowered.org/maven'

With the release of Forge 14.23.2.2638, a proper way to render items with GL was implemented. Using this system is much simpler than the old system, which required a TileEntity, and does not allow access to the ItemStack.

Using TileEntityItemStackRenderer

TileEntityItemStackRenderer allows you to render your item using public void renderByItem(ItemStack itemStackIn).
There is an overload that takes partialTicks as a parameter, but it is never called in vanilla.

In order to use a TEISR, the Item must first satisfy the condition that its model returns true for IBakedModel#isBuiltInRenderer. Once that returns true, the Item's TEISR will be accessed for rendering. If it does not have one, it will use the default TileEntityItemStackRenderer.instance. For an example IBakedModel to use, see below.

@nothings
nothings / kotaku_hzd.md
Last active January 23, 2024 15:24
Why Frustum Culling Matters, and Why It's Not Important

There is a nice GIF illustrating a technique called "frustum culling" in this Kotaku article: http://kotaku.com/horizon-zero-dawn-uses-all-sorts-of-clever-tricks-to-lo-1794385026

The interwebs being what they are, this has also led to some controversy.

Some people have interpreted the opening sentence "Every time you move the camera in Horizon Zero Dawn, the game is doing all sorts of under-the-hood calculations, loading and unloading chunks of world to ensure that it all runs properly," as being about the GIF; that's not what frustum culling does, but that's probably not what the article's author meant anyway.

@7ERr0r
7ERr0r / ChunkPreloader.java
Last active June 27, 2019 08:07
chunk preloader for 1.10.2 (probably only works with OptiFine)
/*
** 2014 August 03
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
*/
package info.ata4.minecraft.minema.client.modules;
@mchorse
mchorse / about.md
Last active May 3, 2017 08:14
Pixel skin editor (written on iPad)

Basic skin editor

Hello there. You're watching ESPN channel, but specifically iPad coding category... Whoa, sorry about that, he-he.

This is standard (Steve's) skin editor. It has really basic features:

  • Pencil
  • Eraser
  • Clear canvas