Giter Club home page Giter Club logo

Comments (6)

mattdesl avatar mattdesl commented on July 22, 2024

The demo should work with any base64 datauri or just a plain url like images/foo/bar.png. It gets passed to the src attribute of an <img> tag, which is then uploaded to a texture. The demo assumes the texture is 512x512.

from glsl-fast-gaussian-blur.

mattdesl avatar mattdesl commented on July 22, 2024

p.s. Feel free to paste some code if you are having trouble. 😄

from glsl-fast-gaussian-blur.

amilajack avatar amilajack commented on July 22, 2024

Which function would I pass the image source to? Instead of:

var uri = require('baboon-image-uri')

could i something like:

var uri = 'http://google.com/someimage.jpg'

(I'm referring to line 13)

This is my repo:
https://github.com/amilajack/glsl-fast-gaussian-blur

from glsl-fast-gaussian-blur.

mattdesl avatar mattdesl commented on July 22, 2024

Yup, you should be able to just replace uri with anything. If you are using a cross-domain image (i.e. it's not hosted on the same server as your index.html) then you may run into problems. You can try using crossOrigin like this:

loadImg(url, { crossOrigin: 'anonymous' }, callback);

p.s. I pushed a slight change to use the load-img module instead of img, since the latter has changed authors from version 0.x to 1.x and is basically unstable. 😄

from glsl-fast-gaussian-blur.

amilajack avatar amilajack commented on July 22, 2024

For me, this works:

loadImage(uri, start)

// var someImage = 'https://upload.wikimedia.org/wikipedia/commons/d/d4/CH_cow_2_cropped.jpg'
// loadImage(someImage, { crossOrigin: 'anonymous' }, start)

and this doesn't

// loadImage(uri, start)

var someImage = 'https://upload.wikimedia.org/wikipedia/commons/d/d4/CH_cow_2_cropped.jpg'
loadImage(someImage, { crossOrigin: 'anonymous' }, start)

These are the only lines I changed after doing a fresh clone.

from glsl-fast-gaussian-blur.

amilajack avatar amilajack commented on July 22, 2024

The demo assumes the texture is 512x512

Is there a way to make this demo work with other image that are of different dimensions?

from glsl-fast-gaussian-blur.

Related Issues (12)

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.