Giter Club home page Giter Club logo

snaptrude-assignment's Introduction

SnapTrude Graphics Assignment

This is the submission of the Graphics Shader Assignment for Snaptrude.

How to install/run

  1. Clone the repo and run
    npm install local-web-server
    This installs a simple web server to run the application.
  2. Now, run npx ws to run the server and use the url address then displayed in your browser to open index.html.
  3. All the tasks will been rendered on index.html

Tasks done

  • Task 1: Create a scene with meshes using the mesh builder and load a custom obj (bunny model) mesh into the scene. (See createScene() in main.js) image

  • Task 2:
    - Return a mesh object when the mouse hovers over it. (See outlineMeshOnHover() in helpers.js).
    - Outline a mesh on hover, using a shader. (See outlineMeshOnHover() in helpers.js).
    Demo: outline.webm

  • Addtional task: Create a UI to set the oulline width and color (See createUI() helpers.js)
    Demo: ui.webm

Approach

The outlining has bene done using post processing with multiple passes. A silhoutte buffer is created to render all selected meshes to a specific color (something like a mask). Another blurred buffer is created to expand the silhoutte and then finally the blurred silhoutte is merged with the original textures to form the outline. References:

  1. https://ameye.dev/notes/rendering-outlines/
  2. https://gamedev.stackexchange.com/questions/68401/how-can-i-draw-outlines-around-3d-models
  3. And obvioulsy, the Babylon.js documentation and community forum.

snaptrude-assignment's People

Contributors

ishan-002 avatar

Watchers

 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.