• Welcome to Dark Bit Factory & Gravity.
 

GLSL shader with Png Image and Scroller Support [Code Included]

Started by Omnikam, April 17, 2017

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

inc.

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
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Omnikam

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  ;)

inc.

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

Omnikam

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

inc.

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

Omnikam

#45
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]


inc.

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
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Omnikam

#47
Okay well ive gone for a VERY unpractical approach

inc.

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

Omnikam

 :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 

Omnikam

Could You try this one  :)  Made a few modifications, hopefully it will render properly
it should have the logo centered regardless of resolution

inc.

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.  :)
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Omnikam

#52
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  ;)

Omnikam

#53
 :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:

inc.

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

Omnikam

#55
Removed

inc.

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

Omnikam

#57
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?

inc.

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

Omnikam

Cheers inc, enjoy the family weekend..Ill keep messing around and post a fix if i work it out  ;)