|
Waves, with sines but no ALLEGRO_FLIP_VERTICAL |
A. van Patmos
Member #15,349
October 2013
|
Basically it's this; ALLEGRO_FLIP_VERTICAL does not work with this code. So I'm doing something wrong. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I can't compile it. All the == and other operators are missing. There are spaces where they used to be. Try saving as UTF-8. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
A. van Patmos
Member #15,349
October 2013
|
Yes, /* and */ were missing too. Strange. Here's a new save in ASCII and one in UTF-8. edit: You'll have to rename water.png to MAR0DST192.png or change the code. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I'm too tired to look tonight. What exactly is the unintended behavior you're witnessing? Computers only do what you tell them to. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Peter Hull
Member #1,136
March 2001
|
Based on looking at the code only, I saw 2 things 1. I don't think you need al_lock_bitmap - that's for when you want direct pixel access to the bitmap's memory (Edgar can confirm this, I can't remember!) Pete
|
A. van Patmos
Member #15,349
October 2013
|
Ok, maybe I misunderstood how to use al_lock_bitmap. Yes I set both amplitudes to 18. You can see a few things: I expected the vertical movement to be the same. edit some more: I attached a pic. |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I don't understand what effect you're trying to achieve. It looks pretty cool to me. :? EDIT EDIT2 EDIT3 Here's the fragment shader I used. 1#version 110
2
3uniform sampler2D tex; // 0
4uniform float time; // effect elapsed time
5
6uniform vec2 surface; // texture resolution
7
8void main()
9{
10 float width = 1.0/4.0;/// In texels
11 float factor = 0.05;/// Factors from 0.01 to 0.1 seem okay
12 factor = factor*sin(time);
13 vec2 uv = gl_TexCoord[0].xy;
14
15 float power = 1.0;
16
17 float xfact = (1.0 + sin((2.0*3.14159265*uv.x/width) + time))/2.0;/// [0,1.0)
18 xfact = pow(xfact , power);
19
20 float yfact = (1.0 + cos((2.0*3.14159265*uv.y/width) + time))/2.0;/// [0,1.0)
21 yfact = pow(yfact , power);
22
23 /// Modify x value by sin(2PI*x/50.0) and y value by sin(2PI*y/50.0)
24 uv = vec2(uv.x + factor*yfact , uv.y + factor*xfact);
25 gl_FragColor = texture2D(tex, uv);
26}
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|