Author Topic: GLSL shader with Png Image and Scroller Support [Code Included]  (Read 3867 times)

0 Members and 1 Guest are viewing this topic.

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #40 on: April 25, 2017 »
about the scroller.

it is located in the main window at:

glOrtho_(#Gad_OpenGL, 640, 0, 240, 0, 1)

Z-View: 0  ----  is fine. it must not be a negative value. 0 is working.

now you wonder why the second value is ZERO.

it is because of the 2nd definition in the Procedure: Draw_ScrollText()

at: YPos = #WindowHeight/2.4
we tell our Scroller, he have to display exactly 240 on the windows Y Axis. 240 = #WindowHeight/2.4


but calling 2 times glOrtho for different images will not work. we must rewrite the code for gfx on GL Screen and call both or more only once with glOrtho command

just checking

edit:
i have a good typer Sourcecode. Maybe you wanna include this one infront of the GL screen :D
« Last Edit: April 25, 2017 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #41 on: April 25, 2017 »
Still working on the Logo. I have today off work,  so I'm going to try to figure this out.  Pjay's  Vroom remake is an excellent resource for learning as he used all opengl.  But I'm basically just trying to catch image encode image bind image to gltexture  create a full screen quad  bind the texture to the quad.  Sounds easy hey  :)  I'm sure it is,  but if you ever saw my pirate demo then you would know my skills are limited.  But I will keep trying Inc. A nice typer is always welcome  ;)

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #42 on: April 25, 2017 »
Sounds good.  Looking forward mate. If you sort something out, lemme see. 
I never seen your "Pirate Demo"  :)

Meanwhile i do some codings on my shader Editor Demo tool: Adding the option to include gfx and music on demand.
And also catching the Font for scrolling or typing infront of the GL Screen.
Lot of work to do :D
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #43 on: April 26, 2017 »
Well I had a partial success,  I managed to get all 3 working,  unfortunately the logo loses transparency,  so no go.  Instead of using quads and gltexture I went with the startdrawing () drawImage stopdrawing () command,  as I said it loses Alpha channel,  I might try my old sprite method next,  I seem to remember getting my sprites to render with Alpha,  so perhaps can be adapted here

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #44 on: April 26, 2017 »
Good news. looking forward to the outcome and hope to see a nice and properly commented sourcecode :D
maybe i can adapt some lines into the Shader Tool then.

currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #45 on: April 26, 2017 »
Well i seemed to have hit a road block with this one, No matter what ive tried i lose the logo`s transparency..Back to the drawing board]

« Last Edit: April 30, 2017 by Omnikam »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #46 on: April 26, 2017 »
Code: [Select]
Procedure Logo()
 CreateImage(0, 800, 600)    ;create image from loaded logo ImageId2

 StartDrawing(WindowOutput(0)) ;startdrawing

 DrawAlphaImage(ImageID(2), 0, 0,255)
 DrawingMode(#PB_2DDrawing_AlphaBlend)  ;Doest do the transparancy like it should
 StopDrawing() 

EndProcedure

not working on a OGL Gadget. this call a canvas and you draw the logo on it. can't be transparent

so, back to the start.

i hope i have some time to help soon
Edit:
I found another site with interesting information.
https://www.sjbaker.org/steve/omniv/opengl_text.html
« Last Edit: April 27, 2017 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #47 on: April 27, 2017 »
Okay well ive gone for a VERY unpractical approach
« Last Edit: April 30, 2017 by Omnikam »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #48 on: April 27, 2017 »
it looks like, you made 2 ogl windows, parent and child and stick em together.
a solution but not the right way :D

my x/y coordinates looks different than yours:



just waiting for more information  and when it's done i hope i can fix it :)
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #49 on: April 27, 2017 »
 :stirrer:  Damm i was wondering if different desktop resolutions would have that effect  :clap: Well now i know  :cheers:   
The second window isnt an Opengl window, it`s a custom transparent window using the Image as window, i then hide the window, I suppose i could use get desktop width and height to align the windows properly. The open Gl solution would be best, a textured quad does sound right, but it was beyond my skill set, if you look a page down you will see my second ever demo, its basic as are my skills 

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #50 on: April 27, 2017 »
Could You try this one  :)  Made a few modifications, hopefully it will render properly
it should have the logo centered regardless of resolution

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #51 on: April 27, 2017 »
Understand.  U made the second Window transparent.  What happen if you grab another Explorer Window and move it over your Demo?

i started your example. the picture should speak for itself:


Let us render the "logo gfx" as an textured quad.  i'll hang on.
Give me a lil time.  I will check your 2nd Demo later.  :)
« Last Edit: April 27, 2017 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #52 on: April 27, 2017 »
Yes back to quads. Transparent window still could have its use, I'll show you something that would give it a cool effect later.  I think I have an idea for the quad issue too,  but not free to explore my idea for a few day's
I think ive figured it out, ill post a quad test soon
 :-[  I failed

But i have a new Test to try out  ;)
« Last Edit: April 28, 2017 by Omnikam »

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #53 on: April 28, 2017 »
 :bfuck2:  :bananaphallus:  :carrot: :||  :bfuck1:   :buddies:
I Did it, After God Knows how many hours and researching and reading. I tried So many times and failed. I swear i was all ready to give up, but then in the quietness of Failure, i had a new idea, why reinvent the wheel when it has already been done? So i looked at Pjays code for his Vroom remake, and hello, the answer was staring me in the face  :inspired:
So here it is my Demo with everything working
Yes Inc , that's textured quad goodness   :cheers:
« Last Edit: April 28, 2017 by Omnikam »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #54 on: April 28, 2017 »
Exactly  :clap:, that's it what ppl expected and wait'n for.

now an well commented SC and we can adapt the GFX options into my Shader Tool :)

well done.
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #55 on: April 29, 2017 »
Removed
« Last Edit: April 30, 2017 by Omnikam »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #56 on: April 29, 2017 »
ok, there is a lil bug. i hope i can find it quick

you made black = transparent. the sourcecode does no longer support the alphablending.  :whack:

currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #57 on: April 29, 2017 »
Well this is the best i could do
Or Transparent is Nice
For some reason whenever the fragment shader is a little complex the scroller slows to a craw?
« Last Edit: April 30, 2017 by Omnikam »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 260
  • Karma: 18
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #58 on: April 29, 2017 »
Ok. I see this is the wrong way you go. We have weekend in germany.  Things to do with family and lil child. As soon i have time,  i fix this Problem.
Good Job over the last days mate :)
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline Omnikam

  • Atari ST
  • ***
  • Posts: 100
  • Karma: 4
    • View Profile
Re: GLSL shader with Png Jpg Support [Code Included]
« Reply #59 on: April 29, 2017 »
Cheers inc, enjoy the family weekend..Ill keep messing around and post a fix if i work it out  ;)