Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom textures #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

custom textures #40

wants to merge 2 commits into from

Conversation

makc
Copy link

@makc makc commented Oct 31, 2015

subj :)

screen shot 2015-10-31 at 14 12 36

@makc
Copy link
Author

makc commented Oct 31, 2015

oh yes, demo link 🍃

@koreus7
Copy link

koreus7 commented Mar 6, 2016

Bump! This is very cool. would love to see this merged.

Should they be upside down though or do I just not understand sampler 2D?

precision mediump float;

uniform vec2 resolution;
uniform sampler2D rings; // http://i.imgur.com/tVVAVLL.jpg
void main( void ) {

    gl_FragColor = texture2D( rings, ( gl_FragCoord.xy / resolution.xy ) );

}

This example makes the upside down thing more obvious

@makc
Copy link
Author

makc commented Mar 6, 2016

you can do gl.pixelStorei (gl.UNPACK_FLIP_Y_WEBGL, xxx) to flip it the way you want to.

@makc
Copy link
Author

makc commented Mar 6, 2016

actually, why not add it, indeed...

@makc
Copy link
Author

makc commented Mar 6, 2016

ok done, but... crap:

This branch has conflicts that must be resolved

@makc
Copy link
Author

makc commented Mar 6, 2016

ha, so github does understand forced push )

@makc
Copy link
Author

makc commented Mar 6, 2016

I guess @mrdoob would merge this way faster if I did not use dick pic as example 😉

@hermanbanken
Copy link

Just use some other picture: head

@makc
Copy link
Author

makc commented Feb 18, 2017

@hermanbanken well, maybe @mrdoob hates the idea any way. you know, like in old demoscene days, using bitmaps instead of code was frowned upon

@koreus7
Copy link

koreus7 commented Feb 23, 2017

Maybe @mrdoob doesn't want glslsandbox to turn into Shader Toy. Also links to images could go dead meaning more broken shaders.

PS: Would be cool to see some shaders that mimic oldskool demoscene stuff.

@mrdoob
Copy link
Owner

mrdoob commented Feb 24, 2017

Hmm, the issue is that this wouldn't scale and it would increase the shader size considerably...

@makc
Copy link
Author

makc commented Feb 24, 2017

@mrdoob if you use data url, yes. but, as you see, imgur url works just as good

@makc
Copy link
Author

makc commented Feb 24, 2017

@mrdoob and, in fact, any other host that allows cross-domain access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants