Skip to content

Instantly share code, notes, and snippets.

View Pikachuxxxx's full-sized avatar
😎
Busy Innovating

Phani Srikar Pikachuxxxx

😎
Busy Innovating
View GitHub Profile
@Pikachuxxxx
Pikachuxxxx / Blender_NameCleanup.py
Last active December 9, 2023 05:18
Scene clean up code to copy scene object name to mesh name in Blender
# [Source] : https://blender.stackexchange.com/questions/46795/is-there-a-quick-way-to-copy-the-object-name-to-the-mesh-data-name
import bpy
objects = bpy.data.objects
for obj in objects:
if obj.data and obj.data.users == 1:
obj.data.name = obj.name
@Pikachuxxxx
Pikachuxxxx / Git add history to already cloned repo.txt
Created October 23, 2022 03:53
Git add history to already cloned repo.txt
Grab the .git directory by cloning a bare repository
$ mkdir repo
$ git clone --bare http://github/user/repo repo
Make the .git directory and move the cloned files
$ mkdir repo/.git
$ mv repo/* repo/.git
Unzip the repository
//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:
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTW
@Pikachuxxxx
Pikachuxxxx / RTIAW.frag
Created March 22, 2022 16:18
Diffuse RT
#version 410 core
// Input from vertex shader
in VS_OUT {
vec3 normal;
vec2 texCoords;
} vs_in;
out vec4 outFragColor;
[https://www.shadertoy.com/view/NtfcRr] - ShaderToy Link: This gist has some unsaved edits cause shader toy login was down
---------------------------------------------------------------------------------
Common
---------------------------------------------------------------------------------
// Path Tracer Settings
// The minimunm distance a ray must travel before we consider an intersection.
// This is to prevent a ray from intersecting a surface it just bounced off of.
const float c_minimumRayHitTime = 0.01f;
// the farthest we look for ray hits
@Pikachuxxxx
Pikachuxxxx / psvita-toolchain-premake5.lua
Last active April 30, 2022 06:35
PSVita premake custom arm-vita-eabi tool chain build test
VITASDK = os.getenv("VITASDK")
if VITASDK ~= nil then
print("VITASDK found at : " .. VITASDK)
else
print("VITASDK Env variable not set, please check your environment settings")
end
-- define custom arm-vita-eabi toolchain for compilation and VPK creation
premake.tools.arm_gcc = {}
@Pikachuxxxx
Pikachuxxxx / ToneMapper.frag
Created October 6, 2021 05:48
A Fragment Shader with various tone mapping algorithms
#version 330 core
#extension GL_ARB_shading_language_include : require
out vec4 color;
uniform sampler2D renderTex;
uniform vec2 resolution;
uniform int toneMapMode;
////////////////////////////////////////////////////////////////////////////////
@Pikachuxxxx
Pikachuxxxx / bone_vs.vert
Created September 21, 2021 04:20
A vertex shader to visualise bones
layout (location = 0) in vec3 VS_IN_Position;
layout (location = 1) in vec3 VS_IN_Normal;
const int MAX_BONES = 128;
layout (std140) uniform u_GlobalUBO
{
mat4 view;
mat4 projection;
};
@Pikachuxxxx
Pikachuxxxx / RoundedMainWindow.h
Last active October 6, 2021 14:27
A small snippet to render a rounded QT main window
void resizeEvent(QResizeEvent* event)
{
QImage image(this->size(), QImage::Format_Mono);
image.fill(0);
int roundness = 20;
if (!this->isFullScreen() && !this->isMaximized()) {
//image.setPixel(0, 0, 1); image.setPixel(1, 0, 1); image.setPixel(2, 0, 1); image.setPixel(3, 0, 1); image.setPixel(4, 0, 1); image.setPixel(5, 0, 1); image.setPixel(6, 0, 1);
//image.setPixel(0, 1, 1); image.setPixel(1, 1, 1); image.setPixel(2, 1, 1); image.setPixel(3, 1, 1); image.setPixel(4, 1, 1);
@Pikachuxxxx
Pikachuxxxx / SplashScreenMacOS.m
Created September 14, 2021 11:05
A splash screen demo using native NSApplication and NSWindow for MacOS
#import <Cocoa/Cocoa.h>
// clang -framework Foundation -framework Cocoa ./src/main.m -o ./bin/main && ./bin/main
@interface SampleClass:NSObject
- (NSImage *)resizedImage:(NSImage *)sourceImage toPixelDimensions:(NSSize)newSize;
- (void) RunApp;
@end
@implementation SampleClass