Coder Social home page Coder Social logo

shaders's Introduction

Shaders

A collection of shaders written in CG/ShaderLab for Unity used in the development of Poi.

Poi was shipped on Unity 5.5.3p1, but the shaders below have also been tested (somewhat) on Unity 2018.


The default Unity shader for transparent objects suffers from some overlapping issues on complex objects (as seen on the left in the following image). This shader fixes the problem by rendering the object in two passes (as seen on the right). The center opaque image is for reference.

Alt text


This simple two-pass shader renders a silhouette on top of all other geometry when occluded. We used this effect in Poi for objects that weren't marked as camera occluders so players would always be able to see the character.

Alt text


This inexpensive screen-door transparency technique is useful for distance culling when traditional transparency is either too expensive or produces artifacts due to depth sorting. We used this in Poi to cull enemies when optimizing for lower-end hardware, specifically the Nintendo Switch.

Stipple


We achieved this depth-aware heat haze effect in Poi by attaching this shader to a geosphere with inverted normals as a child of the camera. This allowed us to easily animate the effect based on distance and didn't interfere with other post-processing effects.

Heat Haze


This basic shader renders a checkerboard pattern (with support for two colors) using the existing vertex UV coords. We mainly used this for prototyping in Poi.

Alt text


This is another basic shader that renders both sides of an object while accounting for correct normals. We used this technique in Poi for animated flags/cloth.

Alt text


This image effect takes a normal map as input and applies it to the screen as a post-process. The normal map will always be centered and scaled appropriately independent of aspect ratio and window resolution. We used this effect for the telescope item in Poi, but it would also work for weapons, binoculars, etc.

Alt text Alt text


This shader extends Unity's default Sprite shader to allow for scrolling texture offsets. For non-Sprite shaders (eg: Renderer components), this can already be accomplished by modifying material.mainTextureOffset, but unfortunately this does not work for SpriteRenderer components, hence the need for this new shader.

Scrolling Sprite

shaders's People

Contributors

ewersp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.