Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / DLL request

Author
Message
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 3rd Apr 2017 14:35
Is it possible with the new DLL options to get ptr data of the backbuffer?

Would like to work on a star field idea and need the ptr of the backbuffer for drawing.
I want to break an image into pixles..and just for a few other simple things, it would be a fun option to have.

Cant use rendertoimage, then make a memblock of the image, then make an image from the memblock.. I get only 20fps with just calling the commands.. without manipulating any data.

Thanks anyhow..
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 3rd Apr 2017 22:02
What is it you are trying to do?
Might be a way without rendertoimage?

CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 4th Apr 2017 03:46
I've also tried GetImage(), creatememblockfromimage(), only get 10fps..

Thing is I don't know yet what I would do as far as coding goes.. I'd like the functionality for experimenting and such.

But its cool, I was just wondering about DLL options because of the new update..

ptr was one thing I'd like to experiment with on my free time..

but still am wondering if it's possible to get ptr with a DLL.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 4th Apr 2017 08:23
GetImage() would be slow for the full screen, the help files explain this.
In DBPro we had access to the backbuffer, and could manipulate it like a memblock. It would be good to be able to do this.
I created some nice screen transitions that worked at 60FPS with direct access to the backbuffer.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 7th Apr 2017 03:41 Edited at: 7th Apr 2017 04:03
ooook now, did some reading, no go on the backbuffer calls.
It will cause a pipline stall.. even when trying to retrieve a simple byte of information..
Using getimage() in agk2 will be just as fast as an OpenGlSL call to gl_FragColor or glReadPixels.

One question, how dose the rendering work in AGK2.. I mean how dose the object data in the gpu get updated...
wasd, mouse x and y?

My guess, the object's vertex data is in the cpu Ram and its texture is in the gpu Ram, in the cpu Ram
the object's vertex data is manipulated(rotation/position) then sent to the gpu for constructing in the
geometric shader, then to the pixle shader for texturing?? Where one vertex can become a complete whole sprite!

Can I make a one way integer to send to the gpu?..one-way, as because retuning data is a major slowdown.

Thanks anyhow.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 8th Apr 2017 18:02 Edited at: 8th Apr 2017 18:03
I think you are talking yourself into having to learn shaders

Even if you just extract the default shaders, you could add a parameter and utilise it.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 9th Apr 2017 06:19
Cool! The AGK2 shader guide right..

I'm currently working on this tutorial. I can understand some of what the AGK2 shader guide was saying now..
Thanks for the reminding, that guide came to mind.

https://www.shadertoy.com/view/Md23DV#

One question, what editor should I use, for debugging?

Some simple guide lines would help allot. Thanks anyhow.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Apr 2017 12:14
I am still a novice at shaders, but I have managed to get some things working.
More importantly, I more or less now understand how they work - not due to any specific documentation (which is the main problem) but by experimenting and reading all the shader related threads on here.

It's also important to understand how AppGameKit uses shaders - especially that shaders are altered dynamically by AGK.

If you export the default shaders (with different effects in AppGameKit turned on) then you have a starting point.

I'm still using notepad to edit shaders, but I am aware that there are pipeline debuggers out there.
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Apr 2017 12:23
Just had a quick look at that tutorial and it's one of the best entry tutorials I've seen - good stuff.

As it's a 2D shader, I would suggest that you would need to adapt it to a full screen shader, or a sprite shader.

Take the demo AppGameKit shaders and strip it down to an empty shell, then keep a copy of that as your "base".
You can then start adding stuff from the tutorial and tweak it until you understand each function.

I might have a play with that tutorial myself at some point.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 9th Apr 2017 12:31
So if my code runs well in C++ using openGL and adding SL support, all I would have to do is remove the headers #version ect.. and place that code into a file.ps file.vs ect..
Then load it into AGK2 and I'm good? Also hoping it runs in 2.0 and 110..
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 9th Apr 2017 20:13
Not quite.

First of all, you'd need to sort out the AppGameKit passed values. I mentioned exporting the default shaders before, but I think they only apply to mesh shaders, so ignore that bit
There's some example fullscreen shaders that come in the AppGameKit demos. See how those are implemented and adapt your stuff to that. I expect full screen and 2D will be easier to adapt to AppGameKit because it's a blank slate so to speak and no environment to cater for, like the 3D shaders need to do.

I did adapt one of the demo full screen shaders (bloom) once and it was quite straight forward.

The shader implementation has changed a couple of times in AppGameKit since I last played with it. Hopefully, someone with more expertise than me will step into this thread at some point

I'd still be curious to know what it is you are trying to achieve though! The render to image stuff I would personally only use if I was generating textures or something not in the main loop as you'd already discovered it's pretty slow.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 10th Apr 2017 05:39 Edited at: 10th Apr 2017 05:41
haha I tried a month ago to mess with the Bloom tutorial.. read some stuff on line could not understand why GPUs used 1.0 for 255 and 0.0 for 0.
I was like, why only black and completely red!, then 1.0/255.0 came to mind.

This shader stuff is fun to learn.. I like how complex it is and only a few people know it.. its a challenge.

I have most of my mind on learning GPU programming.. and am forgetting the simple stuff like modifying what I do have at my disposal.

Thanks for the reminder.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Apr 2017 08:50
Quote: " could not understand why GPUs used 1.0 for 255 and 0.0 for 0."

Because shaders work in the 0.0-1.0 range. (Where 1.0 in the shader is the same as a 255 colour value)
Signature removed by mod because it's larger than 600x120... please resize and try again.
CodeName
7
Years of Service
User Offline
Joined: 30th Dec 2016
Location:
Posted: 10th Apr 2017 19:23
Quote: "why only black and completely red!, then 1.0/255.0 came to mind."


1.0/255.0 = 0.0039215686

I should have made it look a little more equation'e

Login to post a reply

Server time is: 2024-11-24 16:31:55
Your offset time is: 2024-11-24 16:31:55