Giter Site home page Giter Site logo

unitytexturepainter's Introduction

UnityTexturePainter

Simple example of painting straight onto a mesh with a shader.

Video (some genius used the first empty frame as the thumbnail) Video on twitter

  • Attach PaintMe.cs to any mesh with a Collider
  • When the user clicks, a raycast will try and find any object with PaintAt() on it
  • When this is called we grab the UV's where we hit (note: some untextured objects will only have 0,0 for a uv!) and start painting
  • The first time, a RenderTexture is setup, copies the texture from the material on us (or clears a colour if no texture) and assigns itself to the material
  • then (and on subsequent hits) it will set a point to draw a circle at on a shader, then do a blit onto the existing texture

Not the MOST effecient way, but a thousand times better than using SetPixel. And now you can do shapes, masks, gradients, wobbly effects.

Enjoy!

unitytexturepainter's People

Contributors

soylentgraham avatar

Stargazers

ZeroSkyline avatar Michal Nehrajsa avatar Nikita Meleshko avatar  avatar dc g avatar Murat Han Acıpayam avatar  avatar JayLee avatar  avatar 27Army avatar  avatar  avatar kevin ho avatar Konstantin Khomyakov avatar  avatar  avatar Mr. Paparoz avatar Maxim Karpov avatar YangJun avatar  avatar Nicholas Maurer avatar Eric prvncher avatar 邵炜程 avatar Catarina Lopes avatar  avatar Hasan Bayat avatar Enrico Speranza avatar dotlive avatar mika avatar Vatsal Ambastha avatar S. Tarık Çetin avatar Man Sun avatar Endar avatar Seyed Morteza Kamali avatar  avatar  avatar  avatar Satish Goda avatar Torano avatar tallship avatar Syy avatar tomori_hikage avatar Mads avatar  avatar Omid Saadat avatar E avatar Leo avatar Miguel Péres avatar Tim Soret avatar  avatar  avatar Sorab Pithawala avatar John de Plume avatar Alexandre Bordereau avatar  avatar  avatar U3DC avatar li5414 avatar Bloodvortex avatar Laura avatar Gerard Slee avatar Christopher-Marcel Esser avatar Mitch McClellan avatar Jared Schnelle avatar Emile Bosch avatar Michał Wróblewski avatar Matthew avatar

Watchers

Christopher-Marcel Esser avatar James Cloos avatar  avatar Arie Leo 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.