Code Monkey home page Code Monkey logo

Comments (5)

shm-sl avatar shm-sl commented on August 19, 2024 7

@turbo If you use SVG, you can already set the color attribute to url("#gradientID"). https://codepen.io/anon/pen/RzJGJx

from zdog.

desandro avatar desandro commented on August 19, 2024 4

Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.


Thanks for this feature request. No, no current plans for gradient or texture fills. The implementation differs significantly between canvas and SVG, so this would be a substantial feature. Zdog uses flat colors by design as its easy to support for me and easy to developers to use. Once you add in gradients, the next ask is for lighting and shadows. At which point you're better off using Three.js. I'm not completely against gradients and texture fills, but I do feel its not a good fit for how I see the project.

from zdog.

turbo avatar turbo commented on August 19, 2024 3

@desandro That's not the intended direction of my request. You seem to understand my request for "textures" as textures in the 3D engine sense. I mean literal textures, patterns (whatever) applied to the actual 2D shape. Adding grunge, a gradient etc. to character elements to make it visually more interesting, not to make it more "3D" (because we already have that for canvas: http://www.kevs3d.co.uk/dev/phoria/).

from zdog.

turbo avatar turbo commented on August 19, 2024

A good interface would be something along the lines of SVG.js' DrawGradient: https://svgjs.com/docs/2.7/elements/#gradient-constructor

from zdog.

blurymind avatar blurymind commented on August 19, 2024

@shm-sl its a cool demo, but the gradient is 2d and completely flat. What if we want a gradient that is relative to the camera position or one that is radial/ emphasizing whatever shape it renders in.
I guess the real question is how do we do pseudo3d materials :p

from zdog.

Related Issues (20)

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.