Giter Site home page Giter Site logo

Comments (9)

Ulydev avatar Ulydev commented on July 25, 2024 1

@ianfitzpatrick , you're right. push doesn't have a multi-pass system yet, but it should be fairly easy to implement. For now, it only supports drawing each canvas with 1 custom shader, then apply another shader to the final, combined render.
I'll keep you updated about it.

@D0NM , please open another issue so we can keep them organized (and give me some .love so I can help you further, the demo works fine even in fullscreen mode).

from push.

Ulydev avatar Ulydev commented on July 25, 2024

Hello ianfitzpatrick, thanks for opening an issue.

This is a known problem (#1) and unfortunately I can't find a way around it. Push has a setShader function, I recommend you take the shaders code from shine and apply them directly with push. Shine creates additional canvases under the hood, so the push+shine combination makes it only more graphics intensive.

I'll try to do something, but in the meantime you should consider working around that problem.

from push.

ianfitzpatrick avatar ianfitzpatrick commented on July 25, 2024

Okay thanks for getting back to me, I should have looked in closed issues! I'll try and manually apply the shaders instead through push like you mention, thanks.

from push.

Ulydev avatar Ulydev commented on July 25, 2024

Also worth mentioning, next update will have a canvas API that will allow you to create as many canvases as you want to apply different shaders.

from push.

Ulydev avatar Ulydev commented on July 25, 2024

@ianfitzpatrick , I've added the canvas and shader API. You might want to check out the new examples.

from push.

ianfitzpatrick avatar ianfitzpatrick commented on July 25, 2024

@Ulydev Thanks a ton, I got shaders working with the new code examples in the readme!

Just for the benefit of anyone who stumbled on this thread later, in the case of the Shine shaders they are sort of embedded inside of Lua code, so you can't just include them as they are not normal shader files. You have to extract the shader portion to a separate file.

from push.

ianfitzpatrick avatar ianfitzpatrick commented on July 25, 2024

Ah sorry one more question, is there a simple way to apply multiple shaders to one canvas? In Shine there was a chaining system, but push:setShader is not cumulative right, it's just "this is the active shader?"

From what I read in love forums I think I need to setup some kind of multi-pass logic in my draw loop. But just want to make sure I'm not missing a simpler way from within push.

Thanks again.

from push.

D0NM avatar D0NM commented on July 25, 2024

I use 3+ canvases
and apply different shaders to them.
Then I draw all the canvases on the main canvas (where I use the push lib)

on switching to the fullscreen mode I lose all my shaders (they stop working. I apply them, but I see no results).
I have to investigate the bug (my bug, probable).

Your conversation might give me more clues.

from push.

ianfitzpatrick avatar ianfitzpatrick commented on July 25, 2024

@Ulydev Cool, thanks much.

from push.

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.