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 / cerealTest.cpp
Created September 12, 2021 12:46
Test code with cereal serialisation library
#include <iostream>
// Std. Libraries
#include <fstream>
// Cereal Includes
#include <cereal/types/unordered_map.hpp>
#include <cereal/types/memory.hpp>
#include <cereal/archives/json.hpp>
@Pikachuxxxx
Pikachuxxxx / VulkanCheckResult.h
Created August 22, 2021 13:08
Utility Macros to check Vulkan Function VKResult and report them in a nice ASCI formatted way
#include <vulkan/vulkan.h>
#include <unordered_map>
#include <vector>
#include <iostream>
static std::unordered_map<VkResult, std::string> ErrorDescriptions = {
{VK_SUCCESS, "Command successfully completed"},
{VK_NOT_READY, "A fence or query has not yet completed"},
{VK_TIMEOUT, "A wait operation has not completed in the specified time"},
{VK_EVENT_SET, "An event is signaled"},
@Pikachuxxxx
Pikachuxxxx / Window.cpp
Created August 22, 2021 13:07
A ready to use GLFW Window with input management and other utilities
#include "Window.h"
Window::Window(const char *title, int width, int height) : backgroundColor(glm::vec4(0, 0, 0, 1))
{
m_Title = title;
m_Width = width;
m_Height = height;
if(!init())
glfwTerminate();
#include "Camera3D.h"
// Constructor with vectors
Camera3D::Camera3D(glm::vec3 position, glm::vec3 up, float yaw, float pitch) : Front(glm::vec3(0.0f, 0.0f, -1.0f)), MovementSpeed(SPEED), MouseSensitivity(SENSITIVTY), Zoom(ZOOM)
{
this->Position = position;
this->WorldUp = up;
this->Yaw = yaw;
this->Pitch = pitch;
this->updateCameraVectors();
@Pikachuxxxx
Pikachuxxxx / modulatingcircle.frag
Created July 27, 2021 07:06
Pixel shader written in GLSL to generate a modulating travelling waves on a circle
#version 410 core
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
vec2 random2(vec2 st){
st = vec2( dot(st,vec2(127.1,311.7)),
dot(st,vec2(269.5,183.3)) );
return -1.0 + 2.0*fract(sin(st)*43758.5453123);
@Pikachuxxxx
Pikachuxxxx / FookinVulkanNotes.md
Created July 26, 2021 13:06
My personal Vulkan Notes (Works on my machine!)

Vulkan Tutorial #graphics

Overview of Vulkan Application

Instance A Vulkan instance is needed to interface/talk to the Vulkan library, basically issue commands related to Drawing and Pipeline

  • It Involves creating a VkApplicationInfo struct and then a VkInstanceCreateInfo struct followed by vkCreateInstance to create the instance
  • We can add Instance Layer and Instance Extensions
  • Instance layers are also called validation layers, they are useful in debugging purposes
  • Instance Extensions are also the global extensions, since it’s a platform agnostic in-order to use Vulkan with extra capabilities for that platform we need some extensions, the extension enabled at instance layer are globally available.
@Pikachuxxxx
Pikachuxxxx / ImageToPixelArrayINl.cpp
Created July 1, 2021 13:49
Converts the given image into a inl file with image pixel data and meta data
#include<iostream>
#include <fstream>
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
int main(int argc, char** argv)
{
// Read the image data
int width, height, bpp;
@Pikachuxxxx
Pikachuxxxx / ElsevierTemplate.tex
Created June 6, 2021 12:09
Basic Research Paper Template for Elsevier Journals
% Choose between the required format of the article (review copy vs final print)
\documentclass[final, 5p, times, 12]{elsarticle}
%\documentclass[preprint, 12]{elsarticle}
% External Packages
% Journal Name
\journal{Name of the Journal}
% Beginning of the document
\begin{document}
@Pikachuxxxx
Pikachuxxxx / RigToMeshBlender.py
Created April 1, 2021 13:43
A Blender Script to Convert any Rig to Mesh
import bpy
import mathutils
from mathutils import Vector
from math import *
def CreateMesh():
obj = bpy.context.active_object
if obj == None:
@Pikachuxxxx
Pikachuxxxx / CMakeAutoVSFilters.md
Last active February 2, 2021 15:04
How auto-place the ALL_BUILD and ZERO_CHECK and INSTALL projects from CMake into a Visual Studio filter

For anyone else curious I found the answer.

In the CMakeLists.txt add the following commands:

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(PREDEFINED_TARGETS_FOLDER "CustomTargets")

Now the ALL_BUILD, ZERO_CHECK, and even INSTALL projects will all be placed in a Visual Studio Filter called CMakePredefinedTargets