Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - inc.

Pages: [1] 2 3 4 5 6 7 8 ... 13
1
Purebasic / Music Routing Problem
« on: August 06, 2019 »
Hi folks,

after a long time i'm back and have a question.
i wrote a demo code that show up a glsl shader and playing a v2m sound file.

how does it looks like (plain and simple)


after some fails i wanna explain the problem that i have.

If i'm sending the V2M Music Main Out to the Shader, that one of the white SinWave react to the Music nice and smoove does not work properly.


I tried a lot but always unnatural values will be sent to a SinWave and it wobble like this:


this is not what i want :D

define the value as following in Line 96:
Code: [Select]
Change = MP_GetChannelVUV2M(channel, @left.f, @right.f)
and adding the "change" into the shader code in Line 128 as an example:
Code: [Select]
Fragment$ + " float angle = iTime * speed * frequency *" + Change +"+(shift + uv.x) * 2.0;   " + Chr(10)
i know there is anything missing in my thoughts.
maybe some one can help?


if you try to run the code properly, you need a PureBasic Version that support MP3D Lib because i used the v2m Lib that is included. Not to forget in Compiler Settings the LibSubsystem set to : dx9


Code: [Select]
;:
;:  PureBasic Version 5.43 LTS x86
;:
;:
;:  get the MP3D Lib from here:
;:  inc-games-design.de/Tools/Mp3dLib_installer.rar
;:
;:



Enumeration
  #Main
EndEnumeration
Enumeration
  #leftbar
  #rightbar
  #Gad_OpenGL
  #Exit_btn
  #Gadget_exit
  #textgadget
  #Infobar_Font
EndEnumeration
#GL_VERTEX_SHADER = $8B31
#GL_FRAGMENT_SHADER = $8B30
#GL_BGR = $80E0
#GL_BGRA = $80E1
DataSection
  Song:
  IncludeBinary "Sound\mpl.v2m"
  SongEnd:
EndDataSection

;:handle the GLSL needs
XIncludeFile "include\cm_opengl_uni.pbi" : UseModule cm_opengl

Define IsPlaying, EndOfTrackReached, EventGadget
Define.i Event

;:V2M Music File Main Out - left / right
Define MainVULeft.f,MainVURight.f

;:Channels V2M Music File - no need yet
Define Ch0VULeft.f, Ch0VURight.f
Define Ch1VULeft.f, Ch1VURight.f
Define Ch2VULeft.f, Ch2VURight.f
Define Ch3VULeft.f, Ch3VURight.f
Define Ch4VULeft.f, Ch4VURight.f
Define Ch5VULeft.f, Ch5VURight.f
Define Ch6VULeft.f, Ch6VURight.f
Define Ch7VULeft.f, Ch7VURight.f
Define Ch8VULeft.f, Ch8VURight.f
Define Ch9VULeft.f, Ch9VURight.f
Define Ch10VULeft.f, Ch10VURight.f
Define Ch11VULeft.f, Ch11VURight.f
Define Ch12VULeft.f, Ch12VURight.f
Define Ch13VULeft.f, Ch13VURight.f
Define Ch14VULeft.f, Ch14VURight.f
Define Ch15VULeft.f, Ch15VURight.f


Procedure Open_MainScreen()
 
  CreateImage(#Exit_btn,16,16)
  StartDrawing(ImageOutput(#Exit_btn))
  FillArea(1,1,-1,RGB(137,187,229))
  Line(0,16,16,-17,RGB(45, 45, 45))
  Line(0,0,16,16,RGB(45, 45, 45))
  StopDrawing()
  OpenWindow(#Main, 0 , 0, 640, 480,"",#PB_Window_ScreenCentered|#PB_Window_BorderLess|#PB_Window_Invisible)
  SetWindowColor(#Main, RGB(137,187,229))
  SetClassLongPtr_(WindowID(#Main), #GCL_STYLE, #CS_DROPSHADOW)
  ;:exit button
  ImageGadget(#Gadget_exit,WindowWidth(0)-22,2,16,16,ImageID(#Exit_btn))
  TextGadget(#textgadget,5, 1, 567, 20, "GLSL Shader Test: inc 2019",#SS_CENTERIMAGE)
  SetGadgetFont(#textgadget, LoadFont(#Infobar_Font, "Microsoft Sans Serif", 8, #PB_Font_HighQuality))
  SetGadgetColor(#textgadget , #PB_Gadget_BackColor, RGB(137,187,229))
  SetGadgetColor(#textgadget , #PB_Gadget_FrontColor, RGB(15, 15, 15))

 
  OpenGLGadget(#Gad_OpenGL, 0, 20, 640, 460, #PB_OpenGL_Keyboard)
  Init_OpenGL(#Gad_OpenGL, 640, 420)
 
  HideWindow(#Main, #False)

EndProcedure

Open_MainScreen()

  MP_CatchV2M(?Song)  ;LOAD SONG
  MP_PlayV2M(0)       ;0 START SOUND FROM THE BEGINNING           
  MP_SetVolumeV2M(1)
  MP_GetMainVUV2M(@MainVULeft.f,@MainVURight.f)
 
  ;channel = -1
  ;Change = MP_GetChannelVUV2M(channel, @left.f, @right.f)

   
  ;Change = MP_GetChannelVUV2M(channel, @MainVULeft.f, @MainVURight.f)
  ;SetGadgetState(#ProgressBar_6,(Ch1VULeft + Ch1VURight)*20)
;:----------------------------------------------------------------------------------------
  ;:The plain Shader Code
  ;{
Vertex$ = "attribute vec3 position;"
Vertex$ + "attribute vec2 surfacePosAttrib;"
Vertex$ + "varying vec2 surfacePosition;"
Vertex$ + " void main() {"
Vertex$ + " surfacePosition = surfacePosAttrib;"
Vertex$ + " gl_Position = vec4( position, 1.0 );"
Vertex$ + " }"

Fragment$ = " #ifdef GL_ES                                                                       " + Chr(10)
Fragment$ + " precision mediump float;                                                           " + Chr(10)
Fragment$ + " #endif                                                                             " + Chr(10)
Fragment$ + " #extension GL_OES_standard_derivatives : enable                                   " + Chr(10)
Fragment$ + " uniform float time;                                                               " + Chr(10)
Fragment$ + " uniform vec2 mouse;                                                               " + Chr(10)
Fragment$ + " uniform vec2 resolution;                                                           " + Chr(10)
Fragment$ + " const vec3 top = vec3(0.318, 0.831, 1.0);                                         " + Chr(10)
Fragment$ + " const vec3 bottom = vec3(0.094, 0.141, 0.424);                                     " + Chr(10)
Fragment$ + " const float widthFactor = 1.5;                                                     " + Chr(10)
Fragment$ + " #define iTime time                                                                 " + Chr(10)
Fragment$ + " #define iResolution resolution                                                     " + Chr(10)
Fragment$ + " vec3 calcSine(vec2 uv, float speed,                                               " + Chr(10)
Fragment$ + " float frequency, float amplitude, float shift, float offset,                       " + Chr(10)
Fragment$ + " vec3 color, float width, float exponent, bool dir)                                 " + Chr(10)
Fragment$ + " {                                                                                 " + Chr(10)
Fragment$ + " float angle = iTime * speed * frequency *" + Change +"+(shift + uv.x) * 2.0;   " + Chr(10)
Fragment$ + " float y = sin(angle) * amplitude + offset;                                         " + Chr(10)
Fragment$ + " float clampY = clamp(0.0, y, y);                                                   " + Chr(10)
Fragment$ + " float diffY = y - uv.y;                                                           " + Chr(10)
Fragment$ + " float dsqr = distance(y, uv.y);                                                   " + Chr(10)
Fragment$ + " float scale = 1.0;                                                                 " + Chr(10)
Fragment$ + " if(dir && diffY > 0.0)                                                             " + Chr(10)
Fragment$ + " {                                                                                 " + Chr(10)
Fragment$ + " dsqr = dsqr * 4.0;                                                                 " + Chr(10)
Fragment$ + " }                                                                                 " + Chr(10)
Fragment$ + " else if(!dir && diffY < 0.0)                                                       " + Chr(10)
Fragment$ + " {                                                                                 " + Chr(10)
Fragment$ + " dsqr = dsqr * 4.0;                                                                 " + Chr(10)
Fragment$ + " }                                                                                 " + Chr(10)
Fragment$ + " scale = pow(smoothstep(width * widthFactor, 0.0, dsqr), exponent);                 " + Chr(10)
Fragment$ + " return min(color * scale, color);                                                 " + Chr(10)
Fragment$ + " }                                                                                 " + Chr(10)
Fragment$ + " void mainImage( out vec4 fragColor, in vec2 fragCoord )                           " + Chr(10)
Fragment$ + " {                                                                                 " + Chr(10)
Fragment$ + " vec2 uv = fragCoord.xy / iResolution.xy;                                           " + Chr(10)
Fragment$ + " vec3 color = vec3(mix(bottom, top, uv.y));                                         " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.2, 0.20, 0.2, 0.0, 0.5,  vec3(0.3, 0.3, 0.3), 0.1, 15.0,false);    " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.4, 0.40, 0.15, 0.0, 0.5, vec3(0.3, 0.3, 0.3), 0.1, 17.0,false); " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.3, 0.60, 0.15, 0.0, 0.5, vec3(0.3, 0.3, 0.3), 0.05, 23.0,false); " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.1, 0.26, 0.07, 0.0, 0.3, vec3(0.3, 0.3, 0.3), 0.1, 17.0,true); " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.3, 0.36, 0.07, 0.0, 0.3, vec3(0.3, 0.3, 0.3), 0.1, 17.0,true); " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.5, 0.46, 0.07, 0.0, 0.3, vec3(0.3, 0.3, 0.3), 0.05, 23.0,true); " + Chr(10)
Fragment$ + " color += calcSine(uv, 0.2, 0.58, 0.05, 0.0, 0.3, vec3(0.3, 0.3, 0.3), 0.2, 15.0,true); " + Chr(10)
Fragment$ + " fragColor = vec4(color,1.0);                                                       " + Chr(10)
Fragment$ + " }                                                                                 " + Chr(10)
Fragment$ + " void main( void ) {                                                               " + Chr(10)
Fragment$ + " mainImage(gl_FragColor, gl_FragCoord.xy);                                         " + Chr(10)
Fragment$ + " }                                                                                 " + Chr(10)
;}

CreateShader(1, Vertex$, Fragment$)
UseShader(1)

Repeat
  Event = WindowEvent()
  EventGadget = EventGadget()
 
  Render_OpenGL()
  ;: LOOP FUNCTION V2M SOUND 
 
  If MP_IsPlayingV2M()
      IsPlaying=1           ;CHECK IF SONG IS PLAYING
    Else
      EndOfTrackReached=1   ;IF SONG REACHED ITS END
      MP_PlayV2M(0)         ;0 STARTs SONG At THE BEGINNING
    EndIf

 
  Select Event
    Case #WM_LBUTTONDOWN
      If WindowMouseX(#Main) >= 0 And WindowMouseX(#Main) <= 640 And WindowMouseY(#Main) >= 0 And WindowMouseY(#Main) <= 61
        SendMessage_(WindowID(#Main), #WM_NCLBUTTONDOWN, #HTCAPTION, 0)
      EndIf
    Case #PB_Event_Gadget
      Select EventGadget() 
        Case #Gadget_exit
          End
      EndSelect
  EndSelect
  ;ESC END PROGRAM
  If GetAsyncKeyState_(#VK_ESCAPE)
    End
  EndIf
Until Event = #PB_Event_CloseWindow
End

the complete package is attached to this posting.

2
i can provide a sinus generator for windows:



it calculate your values and give a preview. the output can be exported for further usage in C or C++. I used this Gen. back in the late nineties for Playstation 1 C++ coding for Sinus Scrollers and effects / wobbler :D

3
ArtRage is really cool. I bought it last year.  The pics are also painted with it :D

No need for Corel Painter.  I also use PhotoPaint since 1996 or so because i hate Photoshop,  don't know why.

4
Yes, not bad.  which program do you use?

Here are some digital paintings that i made in the past:








5
General chat / Re: The Welcoming Committee
« on: June 08, 2018 »
Hi there,
i subscribed in February 20, 2016 but i haven't written anything about me till now.
I'm coming from germany.
In the early 80th i got an c64 and i started coding gfx and animations on it.
Sadly i never had an Amiga.
In the beginning 90th i started to code on  PC.
I studied IT and became a professional coder. My languages are VB.Net, C/ C++, C#. For hobby Blitz3D, BlitzMax, FreeBasic, PureBasic, C++ with SFML, OpenGL, DX9.
I want to code demos, cracktros keygens but i still train gfx effects ;-).

Best regards,
Spliffer


spliffer, have a look at my new project:
http://www.dbfinteractive.com/forum/index.php?topic=6763.msg84228#msg84228

maybe you like it.

i'm looking for a skilled coder who can handle sesion id's in Purebasic. just try to code a upload tool for Rapidgator. the point is: receiving the uploaded shortlink.

maybe you can help? :)

ahhh ... and welcome

6
Purebasic / Re: Introducing a first Look
« on: June 01, 2018 »
Will you be making this tool open source at some point? Just curious.

Anyway, I'll be looking forward to the initial release that produces usable code. It's looking to be a convenient little time saver.
I really like being able to adjust the various values and see how it looks so quickly and easily.

i think yes, it could be a open source project. latest if i'm heavy stuck :D looking forward.. and yes, later it would be possible to export the settings into PureBasic SourceCode.

I've uploaded a newer Version.

see 1st Post


7
Purebasic / Re: Introducing a first Look
« on: May 24, 2018 »
More Information:

I've uploaded a newer Version.

see 1rst Post

8
CODEF2EXE produziert doch keine MacBinaries oder? Ein G4-Mini kann ja leider kein Windows ausführen.

No it doesn't. It creates x86 win binaries.

Oder meinst Du direkt im Webbrowser mit Java die Dinger anzusehen (wab.com). Muss ich da noch mal nachlesen.

Yes, the exe file communicate with a web based code
War eigentlich dieses INC-Logo mit dem Punkt also (INC.) für PC/CGA anno 1987? auch von Dir?
Hab das gestern erst am EuroPC mit 1084 gesehen :) dat hier => http://www.pouet.net/prod.php?which=67628

Zu blöd dass die keine Ahnung vom coden habe, das hätte mir bei PureBasic sicher geholfen...
so fische ich halt im Trüben...

No sorry that's not me, the very first inc logo that i made was a DOS Logo that change its colors. It can be found in a original bbs release by Monkey Island 1 , called inclogo.com

cheers ;)

9
Das codef2exe ist von mir. Das sollte locker auf dem Mac laufen. Alles andere, was das codef Projekt angeht ist unter der Führung von whitewolf entstanden.
Genauere Infos sind in unserem Forum zu finden.

Grüße

10
kleiner Tipp:

statt pdf kannst du auch direkt Bilder hier einbinden ;)
www.Abload.de

zb als hoster

11
i understand your point, but why doing this if all the stuff exist for windows? :)

12

I already recognized that is not that easy to download cracktro sources for PB and compiling a runable OSX-PPC-Binary.
I tested nearly all the stuff that is available for download here. None worked.

because it was a DOS based scene around 1990 until w98. Purebasic for Democoding is a windows thing so far ;)
but i wish luck in discover some ways to get demos out of a mac .


13
I will have to complete my environment with librarys that are needed in order to get "music" played and gfx "displayed".
Hopefully some of them exist on the mac-plantform.

i don't think so. the Libs would only support Windows

14
Purebasic / Re: Introducing a first Look
« on: May 02, 2018 »
Thank you for the share inc. , always high quality !

is it MP3D based ?

Hi,
no, MP3D is dead. I do no longer use it.

this new Maker will only base on PureBasic Code. Later it will have a option to export all the creation as SourceCode for own and further coding in PB. (but will also have exe export to demo ;) )

15
Purebasic / Re: Introducing a first Look
« on: May 02, 2018 »
another Update yet:


get it from my own ftp (30 MB because of its included images and demo sounds): inc_PB_Demo_SC_Creator.rar

16
Purebasic / Re: Introducing a first Look
« on: May 01, 2018 »
Another slight progress.

Changelog May/01/2018

- load xm and mod music (also show the loaded filename)
- load another logo (add a first simple effect via checkbox)
- now possible to enter own scrolltext into the inputfield (activate the new line with Enter or the Button)
- demoscreen resize possible if entering new x/y coordinates (standard = 800*750)

- resize demoscreen is not bugfree yet
------------------------------------------------------------------------------------------------------------------------------------

more to come ;)

get it from my own ftp (30 MB because of its included images and demo sounds):

I've uploaded a newer Version.

see 1rst Post

17
Purebasic / Introducing a first Look
« on: April 26, 2018 »
Hi folks,

after a longer break, i would like to present a very first alpha? demo making tool

This will help you to create fast and easy sinus or plain scroll text to export the code for PB usage and sooo many more.

first ideas:
- exe export directly from the tool
- support for sound
- logo effects
- 3d effects
- hlsl & glsl support
- custom screen resolution
- sinus and typer Text support
- bitmap font support
- windows font support

and many more.

this version is only for playing around to have a first look on it.

More Information

- all features can be changed in realtime

- on start, it is possible to enter the desired demoscreen resolution
- Sound Support: XM and MOD (many more soundfiles will be play soon)
- Logo
- Sinuous or Plain Scroll Text
- Windows Font can be used (color can be changed via colorpicker)
- Bitmap Font usable
- Typer Text Effect instead of sinous scroller
- Scrolltext: load from text file
- Scrolltext: enter with your keyboard
- free options to choose sinuous behavior for the text scroller
- choose own Demoscreen Window title + year
- save the whole settings as PureBasic Source Code
- save demo into 1 single Exe File
- if wanted, remove the frame from the demo screen window
- Demo window Frame and header's color customizable (color can be changed via colorpicker)

FX:
- DirectX 9 or OGL GLSL Shader Support
- GLSL Live Editor
- 3ds Objecs
- Logo Effecs


NEW UPDATE  June 10/2018


- 3d Starfield
- Change Color of the Demo's Window via Colorpicker
- Change Color of the Demo's Window Title via Colorpicker
- Hide/ Show the Settings Button
- correct display-effect when checking the Logo Effect Box

--------------------------------------------------------------------------
In Progress:
- Colorpicker need to be centered on Screen



Start Resolution Requester


Demo Live Preview


Settings Screen


cheers


inc_PB_Demo_SC_Creator.rar

18
General coding questions / Re: voxel waves
« on: April 04, 2018 »
Can you upload a picture by this effect?  I think i did this back in the days on PlayStation 1 in some Cracktros.
If it is the same,  i can provide code

Cheers

19
Projects / Re: Had a bit of fun making this patcher
« on: March 17, 2018 »
Congrats.
Do you write new registry keys while patching or is there more?
I did something similar in this one:
http://www.dbfinteractive.com/forum/index.php?topic=6732.msg84103#msg84103

Will have a look to yours later.

20
Purebasic / Re: [Retroremake] Amstrad CPC for fun
« on: February 16, 2018 »
 delete the attachment,  create a new zip with all needed files and attach it to your created post while Click on modify.

Pages: [1] 2 3 4 5 6 7 8 ... 13