Giter VIP home page Giter VIP logo

tywrenderer's Introduction

tomasgraphics.mp4

TywRenderer

Coverity Scan Build Status

Vulkan Renderer. Work in progress. All testing was done on (AMD R9 480)

  • Warning. Take the code with grain of salt as it might violate Vulkan specs.
  • Big Warning. Some of resources are not freed correctly. Work in progress...
  • Always happy to hear what could be fixed or improved.
  • Still have validation errors on some projects. Work in progress....

How to Build

Currently works only under windows.

Go to ScriptsWin32 folder

  • Run ConfigAndBuildDependencies.bat -> It will build dependencies and will create their .libs and .dlls files
  • Go to External\freetype\builds\windows\vc2017 and build Debug and Release (No multithreading)
  • Run Config.bat -> Will create new folder 'Build' and will create project solution.
  • Then run Build_Debug.bat or Build_Release.bat which will compile the project.

In order to get working. You need to have working Vulkan driver and Vulkan SDK that you can download from LunarG site

Dll and Lib dependencies

  • Assimp (Zlib)
  • SDL
  • Freetype

Please check ThirdParty Licenses

Credits

rojects

Shader - [Triangle Shader](Assets/Shaders/Triangle)

Shader - [Texture Shader](Assets/Shaders/Texture)

The fonts texture were generated using Freetype2 library. The texture format that is generated by freetype is VK_FORMAT_R8_UNORM For each glyph a texture is generated and put it into descriptors list. Of course it very bad thing to do. The best thing is to have one texture for all glyps and point to specific char UV coordinates. In order to have alpha enabled you need to enable blending in your VkPipeline. First one is using signed distance field, the second one(down) does not use signed distance field. There are still some strange edge bleeding which I do not know really why. > - [Signed distance field shader](Assets/Shaders/FontRendering/FontRendering.frag) > - [Non Signed distance field shader](Assets/Shaders/FontRendering/NonSdf.frag)

Shader - [Normal Mapping Shader](Assets/Shaders/NormalMapping)

Shader - [Static Model Shader](Assets/Shaders/StaticModel) There are issues with normal mapping. Shader is not complete. Using TBN Matrix convert view vector and light vector to tangent space. Doing this results in black model. Using my own wavefront parser.

Shader (should be renamed to gpu instead of cpu... cuz gpu skinning it is) - [Static Model Shader](Assets/Shaders/SkeletalAnimation) GPU skinning of MD5 file. MD5 file usually have less then 9 bones per vertex (usually max is 4 in game industry), so had to setup second vec4 for boneWeight and jointId. Also, glm does not handle well small angles so had to use different version of slerp which would handle small angles. Some info about getting MD5 rendering part is here -> https://github.com/gszauer/3DAnimation/blob/master/MD5/README.md

[Shadow Maping Shader](Assets/Shaders/ShadowMapping). Shadow mapping with higher depth buffer range. More about shadow maps can be found on here: - http://outerra.blogspot.co.uk/2012/11/maximizing-depth-buffer-range-and.html - http://learnopengl.com/#!Advanced-Lighting/Shadows/Shadow-Mapping - http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/

[Deferred Rendering Shader](Assets/Shaders/DeferredShading) It uses only two textures. Both textures are compressed and their format is VK_FORMAT_R32G32B32A32_UINT. First texture has compressed position and specular texture, both of them are vec3 type. We waste one A32 component. For some reason got it working only with 4 components (will need to try fixing it). Second texture has packed Normal, Diffuse and Depth textures. If you would look at better compression algorithms, you could definetily find a way to pack Position, Diffuse and Specular in single R32G32B32 but of course you would lose precision. The solution I'm using this time gave the best results without any loss in quality. The only problem is that the output looks litlle bit squashed. Some usefull links on this thing: > http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ > http://stackoverflow.com/questions/6893302/decode-rgb-value-to-single-float-without-bit-shift-in-glsl

[Physical Based Shader](Assets/Shaders/PhysicalBasedShading) Big part of the code is based on the Frostbite documentation on PBR. //http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr_v2.pdf

[SSAO shader](Assets/Shaders/SSAO) Based on John Champan tutorial for Normal oriented SSAO. http://john-chapman-graphics.blogspot.co.uk/2013/01/ssao-tutorial.html

Uploading tomasgraphics.mp4…

License

Copyright (c) 2016 Tomas Mikalauskas

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 SOFTWARE.

Some of the assets have different license. Please comply to these when redistributing or using them in your own projects :

tywrenderer's People

Contributors

tomasgdc avatar

Stargazers

Ali Sajid Imami avatar Nikita Ivanov avatar  avatar Joshua Brewster (Bubba Skrimp) avatar Ju-Hyung Lee avatar Matthew Fosse avatar  avatar Ludovico Cellentani avatar Edin Purkovic avatar 马迪 avatar  avatar

Watchers

 avatar

Forkers

sliderbeen

tywrenderer's Issues

Fix shader code for input and output

Before updating from 16.10.3 AMD Driver version to 16.11.2 I have not had any problem with shader code. But with new update, vkCreateGraphicsPipelines fails with error:

"The thread tried to read or write data that is misaligned on hardware that does not provide alignment. For example, 16-bit values must be aligned on 2-byte boundaries; 32-bit values on 4-byte boundaries, and so on."

Fix:
Change in and out to use struct and layout location. Like in this:
ocornut/imgui@53126cd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.