ourvice

Members
  • Content Count

    18
  • Joined

  • Last visited

  1. float bind;//radius of 1:1 effect if (power > 0.0) bind = sqrt(dot(m, m));//stick to corners else {if (prop < 1.0) bind = m.x-0.3; else bind = m.y-0.3;}//stick to borders if you offset m vec2 slightly I get the effect i was after which is nice it in sense forces a spherical and push the peripheral pixels past the viewer. thank you all for the help, this was fun
  2. still trying to figure out how to get more of a circular indent in the lens instead of an elliptical buldge / indent... but running smooth as butter in the context of the app performance wise
  3. you are awesome yeah i can get it centering pretty well when i remove : vec2 m = vec2(0.5, 0.5 /prop); //center coords /prop the / prop bit the original code in shader then multiplied it in the last to lines to the uv. vec3 col = texture2D(uSampler, vec2(uv.x, -uv.y * prop)).xyz;//Second part of cheat //for round effect, not elliptical fragColor = vec4(col, 1.0); My feeling is this is what gives it the edge flying past effect present in the shadertoy code ( when the fish eye is in ) and would, also ensure the roundness of the fisheye... https://www.shadertoy.com/view/4s2GRR Your thoughts? Thanks for the help btw, I starting to get the shader language a little better Awesome!
  4. right on on my local build ( its inside a larger react app. ) it still is not centering with PixiJS 4.8.1 - ✰ WebGL ✰ i am setting it to app.render.screen this.p.containerouter.filterArea = this.app.renderer.screen
  5. right on will keep fiddling with it if you constrain the filter area with the size of the sprite you can see what i mean :0 https://jsfiddle.net/parsab1h/795/
  6. this is awesome. I got it up and working fairly smoothly on the end product. However is there a way to center the fisheye center? It seems that if it is non square it does not really remain circular or the center point in the middle. Im going to take another look. Thank you so much for looking at this.
  7. they end result will be on a full screen container with sprites inside. thanks all
  8. Hopefully an expert soon... trying to get it to display, then I can muss with the IMouse vectors and make it animate.. any insite into what i'm doing wrong here>? https://jsfiddle.net/parsab1h/735/ Thanks brother!
  9. ahhhhhh https://jsfiddle.net/parsab1h/716/ much closer! all black but now loading the webgl program!
  10. getting there... obviously still not correct.... sigh lol https://jsfiddle.net/parsab1h/709/ thanks for all your patience. first foray into modifying shader toy stuff to pixi v4
  11. right on man. I am trying. I will update the fiddle link as I try to rework it to get it to play well. https://jsfiddle.net/parsab1h/698/
  12. yeah it still does not recognize it as a WebGLShader... https://jsfiddle.net/parsab1h/686/ Uncaught TypeError: Failed to execute 'attachShader' on 'WebGLRenderingContext': parameter 2 is not of type 'WebGLShader'. at compileProgram (pixi.js:2575) at Shader (pixi.js:1792) at new Shader (pixi.js:8057) at FilterManager.applyFilter (pixi.js:18335) at Filter.apply (pixi.js:17833) at FilterManager.popFilter (pixi.js:18278) at Sprite.renderAdvancedWebGL (pixi.js:9233) at Sprite.renderWebGL (pixi.js:9170) at Container.renderWebGL (pixi.js:9176) at WebGLRenderer.render (pixi.js:17052)
  13. sounds good. this is where I am at for the shader frag ( assuming this is correct ) precision mediump float; uniform vec2 iResolution; uniform vec4 iMouse; uniform sampler2D uSampler void main(void) { vec2 p = fragCoord.xy / iResolution.x;//normalized coords with some cheat //(assume 1:1 prop) float prop = iResolution.x / iResolution.y;//screen proroption vec2 m = vec2(0.5, 0.5 / prop);//center coords vec2 d = p - m;//vector from center to current fragment float r = sqrt(dot(d, d)); // distance of pixel from center float power = ( 2.0 * 3.141592 / (2.0 * sqrt(dot(m, m))) ) * (iMouse.x / iResolution.x - 0.5);//amount of effect float bind;//radius of 1:1 effect if (power > 0.0) bind = sqrt(dot(m, m));//stick to corners else {if (prop < 1.0) bind = m.x; else bind = m.y;}//stick to borders //Weird formulas vec2 uv; if (power > 0.0)//fisheye uv = m + normalize(d) * tan(r * power) * bind / tan( bind * power); else if (power < 0.0)//antifisheye uv = m + normalize(d) * atan(r * -power * 10.0) * bind / atan(-power * bind * 10.0); else uv = p;//no effect for power = 1.0 vec3 col = texture2D(uSampler, vec2(uv.x, -uv.y * prop)).xyz;//Second part of cheat //for round effect, not elliptical fragColor = vec4(col, 1.0); }
  14. Awesome Yeah the major error is it did not recognize it as a webglshader. Likely because of the non webgl1 bits... I will keep at it