Recent

Author Topic: Fast Canvas Library V1.052  (Read 31468 times)

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #105 on: February 20, 2026, 08:59:25 pm »
Hi

This is the last debugged version and some nice fx of the Glcanvas.

The old demos are not working with this version, (gl) was removed from uses in unit1 and
Gluint was replaced by TGLTextureID; new type def ;

So please  try this demo ; or live example on my YT channel;

https://www.youtube.com/watch?v=HCwqh8yWklk

Don't forget HeadPhone :)

Regards
« Last Edit: February 20, 2026, 10:24:51 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #106 on: February 24, 2026, 05:48:49 pm »
Hi

You know i'am working on glCanvas every day and make some intro to
improve and debug the library.

The latest one is  bitmap font multi sinus intro done by internal shader command.
the live example a bit different : https://www.youtube.com/watch?v=bJ_UONnhTOw

Be patient for V 1.0;

Regards
Gigatron
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #107 on: March 02, 2026, 12:15:25 am »
Nice

Try to release V1.0 beta now ;
Some new fx commands have 50000 parameters sorry :)

Demo sound fonts are included with this nice library Glcanvas;

Regards

GTR
« Last Edit: March 07, 2026, 11:44:30 pm by Gigatron »
Coding faster than Light !

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: Fast Canvas Library V1.052
« Reply #108 on: March 02, 2026, 03:32:17 am »
Привет, Gigatron!
Если интересно, то некоторую функциональность можно немного "упростить" и в понимании и в передаче данных.
Например можно задавать цвет либо посредством структуры или посредством LongWord. В первом варианте мы создаём структуру и можно задать данные по умолчанию:

Google translate:
Hi, Gigatron!
If you're interested, some functionality can be slightly simplified, both in terms of understanding and data transfer.
For example, you can set the color either through a structure or through LongWord. In the first option, we create a structure and can set default data:
Code: Pascal  [Select][+][-]
  1. type
  2.   myTColor = record
  3.     R, G, B, A: Single;
  4.   end;
  5. var                               // or constant
  6.   whiteColor: myTColor = (1, 1, 1, 1);
  7.   blackColor: myTColor = (0, 0, 0, 0);

Во втором варианте мы из целого числа работаем только с байтами. В этом случае число LongWord - RRGGBBAA (или AARRGGBB).
Различные варианты можно увидеть в разных движках и графических редакторах. Для передачи данных в процедуру или функцию, такие вещи проще. Просто передаём структуру или число RRGGBBAA и используем их.
Возможно ещё проще создавать объекты и все данные хранить в объектах. А все функции и процедуры уже будут работать от самих объектов (в основном).

Это только информация к размышлению! Успехов!

Eng: In the second option, we work only with bytes from the integer. In this case, the LongWord number is RRGGBBAA (or AARRGGBB).
Different options can be seen in different engines and graphic editors. Passing data to a procedure or function is simpler. We simply pass the RRGGBBAA structure or number and use it.
It might be even easier to create objects and store all data in objects. And all functions and procedures will work from the objects themselves (mostly).

This is just food for thought! Good luck!  :)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

n7800

  • Hero Member
  • *****
  • Posts: 680
  • Lazarus IDE contributor
    • GitLab profile
Re: Fast Canvas Library V1.052
« Reply #109 on: March 02, 2026, 04:36:24 am »
And also notice that glCanvas is also not needed to be added here, nor lazopenglcontext, just this:

Code: Pascal  [Select][+][-]
  1.   Forms, Unit1; //lazopenglcontext, glCanvas, soundtracker_lib, SoundtrackerAudio;
  2.  

Notice that every file you include in project inspector will be added here and if they are not essencial for functioning (as components, for instance), they will make problems.

By the way, this is controlled by the option with the long name: "Project Options > Miscellaneous > Main unit has Uses section containing all units of project".

I'll add that some units, on the contrary, must be specified even if they are not explicitly used. For example, these are the standard cthreads and Interfaces units for a GUI application, since they have an initialization section that runs when the program starts.

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #110 on: March 02, 2026, 10:55:07 pm »

Google translate:
Hi, Gigatron!
If you're interested, some functionality can be slightly simplified, both in terms of understanding and data transfer.
For example, you can set the color either through a structure or through LongWord. In the first option, we create a structure and can set default data:
Code: Pascal  [Select][+][-]
  1. type
  2.   myTColor = record
  3.     R, G, B, A: Single;
  4.   end;
  5. var                               // or constant
  6.   whiteColor: myTColor = (1, 1, 1, 1);
  7.   blackColor: myTColor = (0, 0, 0, 0);

Hi thank you , i have the same color option on glCanvas;

Code: Pascal  [Select][+][-]
  1.  TglColor = record
  2.     r, g, b, a: Single;  // r,g,b,a := glmakecolor(1.0,0.0,0.0,1.0); one time
  3.   end;  

And usage is like this :

Code: Pascal  [Select][+][-]
  1. procedure TForm1.OpenGLControl1Paint(Sender: TObject);
  2. var
  3.  
  4.   mycol : TglColor;
  5. begin
  6.  
  7.   mycol := glMakeColor(1.0,0.0,0.0,1.0);
  8.  
  9.   glFillScreen(OpenGLControl1, mycol.r,mycol.g,mycol.b,mycol.a);
  10.  

Regards
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #111 on: March 02, 2026, 10:57:43 pm »
And also notice that glCanvas is also not needed to be added here, nor lazopenglcontext, just this:

Code: Pascal  [Select][+][-]
  1.   Forms, Unit1; //lazopenglcontext, glCanvas, soundtracker_lib, SoundtrackerAudio;
  2.  

Notice that every file you include in project inspector will be added here and if they are not essencial for functioning (as components, for instance), they will make problems.

By the way, this is controlled by the option with the long name: "Project Options > Miscellaneous > Main unit has Uses section containing all units of project".

I'll add that some units, on the contrary, must be specified even if they are not explicitly used. For example, these are the standard cthreads and Interfaces units for a GUI application, since they have an initialization section that runs when the program starts.

Nice, and thank you, let's let users choose this ;)
Coding faster than Light !

Seenkao

  • Hero Member
  • *****
  • Posts: 751
    • New ZenGL.
Re: Fast Canvas Library V1.052
« Reply #112 on: March 02, 2026, 11:20:43 pm »
And usage is like this :
Заранее извиняюсь. Я возьму для примера твой кусочек кода. И применю "свои" правки.

Google translate:
My apologies in advance. I'll use your code snippet as an example and apply "my" edits.

Code: Pascal  [Select][+][-]
  1. procedure glDrawText(x, y: Integer; const txt: string;
  2.                      const textColor: TglColor = whiteColor;                                              // whiteColor - const or var
  3.                      fontName: string = 'Arial'; fontSize: Integer = 14;
  4.                      fontStyle: TFontStyles = [];
  5.                      Angle: Single = 0; CenteredRotation: Boolean = False;
  6.                      CenteredText: Boolean = False);
  7. begin
  8.   ...
  9.   glColor4fv(@textColor);
  10.  
  11.   ...
  12. end.
но лично я указателями пользуюсь.
А вообще, большинство рекомендуют переходить на OpenGL 3+ или на Vulkan.  ;)

Eng:
But personally, I use pointers.
In general, most people recommend switching to OpenGL 3+ or Vulkan. ;)
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #113 on: March 03, 2026, 12:18:18 am »
Ok just made an overload procedure with pointer;

Code: Pascal  [Select][+][-]
  1. // surcharge ; avec pointeur
  2. procedure glDrawText(x, y: Integer; const txt: string;
  3.                      const textColor: TglColor  ;
  4.                      fontName: string = 'Arial'; fontSize: Integer = 14;
  5.                      fontStyle: TFontStyles = [];
  6.                      Angle: Single = 0; CenteredRotation: Boolean = False;
  7.                      CenteredText: Boolean = False); overload;  
  8.  
  9. .............
  10. glColor4fv(@textColor);
  11.  
  12. usage;
  13. glDrawText(100,100,'HELLO',glMakeColor(1.0,1.0,1.0,1.0),'Arial',32);
  14.  

Thank you



Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #114 on: March 08, 2026, 01:09:53 am »
Hi

Let me share the next beta version of Glcanvas;

Live Version on YT; https://www.youtube.com/watch?v=QN4SPSge8vc

Regards

GTR
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #115 on: March 09, 2026, 08:32:15 pm »
Hi 

My goal is almost achieved, out of the millions of possible effects on Amiga I managed to make a demo maker engine. Of course to have all the effects I need another 10 years:) By the way, I've almost finished the protracker player based on @Hukka's Propulse. A live demo of the player of a complex module and the latest beta version of Glcanvas with new effects.
With GlCanvas you can do 1% of Existing Amiga Effects ;

Texture twister based on Cravo - Twister .

Code: Pascal  [Select][+][-]
  1. // Twister, based on http://ddoodm.com/gen/Processing/Twister2.pde
  2. // main article here: http://ddoodm.com/wordpress/?p=104
  3.  
  4. void mainImage( out vec4 fragColor, in vec2 fragCoord )
  5. {  
  6.         fragColor = vec4(0.0, 0.0, 0.0, 1.0);
  7.    
  8.         float vamp = 1.0 + 2.0 * sin(iTime);
  9.     float roto = 2.0 + 2.0 * sin(iTime);
  10.    
  11.     float fv = fragCoord.y / iResolution.y;
  12.     float deg90 = 0.5 * 3.14159;
  13.    
  14.     float theta = iTime;
  15.     float x[4];
  16.    
  17.     for (int i = 0; i < 4; i++ )
  18.     {
  19.         x[i] = 0.5 + 0.25 * sin(vamp * fv + roto + theta + deg90*float(i));
  20.     }
  21.    
  22.     // Line colours
  23.         float lum[4];
  24.         for(int i=0; i<4; i++)
  25.         {      
  26.         float len = 0.35+abs( x[i] - x[int(mod(float(i)+1.0,4.0))] );
  27.         lum[i] = 1.0 - len;
  28.         }
  29.    
  30.         // Transform x[i] to clip coordinates
  31.         for(int i=0; i<4; i++)
  32.     {
  33.         x[i] = (x[i] * iResolution.x);    
  34.     }
  35.    
  36.     // Draw
  37.         for(int i=0; i<4; i++)
  38.         {
  39.         if(x[i] >= x[int(mod(float(i)+1.0,4.0))])  continue;
  40.  
  41.         if ( fragCoord.x >= x[i] && fragCoord.x < x[int(mod(float(i)+1.0,4.0))] )
  42.         {  
  43.             float v = mod(fragCoord.y, 128.0) / 128.0;
  44.            
  45.             float dx = x[int(mod(float(i)+1.0,4.0))] - x[i];
  46.             float u = (fragCoord.x - x[i]) / dx;
  47.            
  48.            
  49.             float c = lum[i];
  50.             c = c * c;
  51.             vec3 col = vec3(c,c,c) * texture(iChannel0,vec2(u,v)).xyz;
  52.             fragColor = vec4(sqrt(col),1.0);
  53.         }
  54.         }
  55. }

// Glcanvas internal texture twister shader alot modifyed Cravo's source ;

Code: Pascal  [Select][+][-]
  1. void mainImage( out vec4 o, in vec2 p )
  2. {
  3.     const float TAU = 6.28318;  //2xPI
  4.     const float FACES = 4.0;
  5.  
  6.     vec2 fc = p;
  7.     p = ((p/iResolution.y)-(iResolution.xy/iResolution.y)/2.);
  8.  
  9.     float twist = iTime + 4.*sin(p.y)*2.0*cos(iTime);
  10.     float twidth = 0.3;
  11.     float fade = 1.0;
  12.  
  13.     for(float i=0.; i<FACES; i++)
  14.     {
  15.        
  16.         vec2 edge = twidth * sin((vec2(i,i+1.)/FACES)*TAU + twist); // twist formule
  17.  
  18.         if(p.x >= edge.x && p.x <= edge.y)
  19.         {
  20.             float dx = edge.y - edge.x;
  21.  
  22.             float u = (p.x - edge.x) / dx;          // position dans la face
  23.             float v = fc.y / iResolution.y;       // répétition verticale
  24.  
  25.             float shade = 0.4 + 0.6*abs(cos((i/FACES)*TAU + v));
  26.             vec3 tx = texture(iChannel0, vec2(u,v)).rgb;
  27.             o = vec4(tx * shade, 1.0)*fade;
  28.  
  29.             return;
  30.         }
  31.     }
  32.  
  33.     o = vec4(0.);
  34. }


Projet not released .. protracker source code is really not finished and not cleaned yet .
Live demo ;

https://www.youtube.com/watch?v=cSxYDFl6vQc

And the last beta demo on YT;
https://www.youtube.com/watch?v=LCfW5PjYf4U

Regards

Gigatron
« Last Edit: March 17, 2026, 12:19:09 am by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #116 on: March 22, 2026, 02:22:37 am »
Hi

Here is the Latest and Final Release of GlCanvas V1.0;
This library include more and more fx with less code and used
to make screen fx or Oldschool demo fx using lot of internal shader:

PlasmaFBMShader, PlasmaShader, PlanetShader, FlagShader, WaveShader, GlowShader, PhongBallShader, PulstarShader, StarNestShader, CounterShader, TubeShader, StarFieldShader, CandyBarShader, FloodShader, FontCopperShader, FontReflectionShader, ScreenShaderWave, TunnelShader, FloorShader, RasterShader, CheckerBoardShader, CheckerLayerShader, TextureCopperShader, TwistShader, GridLine3DShader, TextureInterleaveShader, TextureParallaxShader, BamigaFloorShader, TextureBumpLightShader, DotTunnelShader, SquareTunnelShader, ShapeTunnelShader, SkyShader, SceneTransitionShader

Screen Shader affect all glCanvas;

ScreenShader, ScreenShaderCRT, QuantizeShader, ResolutionShader, Screen3DShader, Shader8bit, Screen3DCubeShader, ScreenTVShader, RGBAShader, ScreenMosaicShader, ScreenBinaryShader, ScreenCopperShader, ScreenReflectShader

And other 2d , 3d primitives ;

** if you want special Fx or shaders let me know thx **

Have  Fun

Regards Gigatron
« Last Edit: March 22, 2026, 11:01:25 pm by Gigatron »
Coding faster than Light !

Gigatron

  • Sr. Member
  • ****
  • Posts: 414
  • Amiga Rulez !!
    • Gigatron Shader Network Demo
Re: Fast Canvas Library V1.052
« Reply #117 on: April 14, 2026, 08:39:38 pm »
Hi

I am working for the next version of glCanvas V1.01 wich include some
new visual effects .. Here is the last demo example of kaleidoscope shader
made years ago with BGRA component.

Add - glScreenGaussianBlur ; glScreenMotionBlur

https://www.youtube.com/watch?v=3oHNFHjUboM

Regards

Gtr
« Last Edit: Today at 01:36:13 am by Gigatron »
Coding faster than Light !

 

TinyPortal © 2005-2018