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.

Work in Progress / Image Kit - Manipulate your images in-game!

Author
Message
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th May 2010 23:17 Edited at: 10th May 2010 23:19
Quote: "Interestingly, the new fadeout program that you first posted for me works with the set display mode change."


The first example uses the CPU to calculate the new image. I'm locking the image data so I can access it with pointers. The target images use DirectX to draw, and so the commands used on target images depend on DirectX itself. Basically they're treated completely different, which made it hard to make the commands 'look' the same for both types of images. A command working with one type and not the other isn't really strange.

But, I think I know what the problem is. It only will require some time to code, and that I haven't right now.
I'll try to fix it this week. Please bare with it for now.

Cheers!
Sven

Todd Riggins
20
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 11th May 2010 00:00
Ahh I'm glad you can decipher my ramblings!

No rush. Thanks

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 14th May 2010 22:01
Hi again,

I looked into the problem and discovered that what I thought that was wrong, wasn't. One of those frustrating moments...

BUT, what I did do is introduce a new function:
reset image kit
And it just resets my resources.
I know it's not the most beautiful solution, but it does work.

I will upload the update in a moment. Please check the first page for the update.
If you're only interested in the DLL, download attachment. You can then add the line
Reset Image Kit==*no parameters*
in [DBP]>Editor>Keywords>ImageKit.ini to see highlighting.

Cheers!
Sven B

Attachments

Login to view attachments
Todd Riggins
20
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 15th May 2010 00:05
It works! You Rock Sven!

Thankyou for your time to getting that to work.

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Dr Tank
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Southampton, UK
Posted: 15th May 2010 01:55 Edited at: 15th May 2010 01:58
Haven't tried this out yet, but it looks really really useful. Thanks. On many occasions in DBP i've wanted the ability to draw to images currently in use - make image from memblock is too slow for large images. This appears to be the image equivalent of the object vertexdata commands!

Using this would enable a higher resolution minimap for my game. I may even be able to draw moving radar dots to it, rather than using separate objects! My minimap is currently one of the main things that limits my framerate.

Does this update mipmapped images properly? If so that's extra awesome. If not it's still super useful.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 15th May 2010 11:18
Quote: "It works! You Rock Sven!

Thankyou for your time to getting that to work."


You're welcome. I'm glad it helped.

Quote: "Does this update mipmapped images properly? If so that's extra awesome. If not it's still super useful."


I did not pay special attention to mip-maps so I don't really know. It's worth looking into though (after I get this horizontal/vertical blur implemented).

Cheers!
Sven B

smaas
16
Years of Service
User Offline
Joined: 29th Oct 2008
Location: Edam, Netherlands
Posted: 20th May 2010 22:51
Im trying to change the color of a pixel,

Image Dot 2, x, z, rgb(1,1,1)

no problem great, but I also want to change the alpha channel, is there a RGBA command or something else?
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st May 2010 11:43
Hi smaas,

The most simple would be using the hexadecimal representation of a color: 0xAARRGGBB, where AA is the hex value of the alpha channel, RR, GG, BB are the hex values of the other channels red, green and blue.

EG. rgb(1, 1, 1) is 0xFF010101, you can change the alpha channel by changing the first 2 characters.
0 = 0x00
64 = 0x40
128 = 0x80
255 = 0xFF
(you can use an online hex-dec converter for this if you want).

Or you can download IanM's MatrixUtils plug-in that has this function built in, or make a function.

Cheers!
Sven B

smaas
16
Years of Service
User Offline
Joined: 29th Oct 2008
Location: Edam, Netherlands
Posted: 21st May 2010 23:26
Thanks, so easy, I should have figured it out myself
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd May 2010 11:52
Hi guys,

Update v1.11

- Introduced new commands: Blur Image Horizontal/Vertical, Paste Image Rotated/Desaturated/Brightness, Reset Image Kit (officially)
- Fixed the direction of a positive angle for Paste Image On Image

Download attached to first post (here).

Cheers!
Sven B

ActionSaxon
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: United Kingdom
Posted: 23rd May 2010 13:07
@Sven B:

Great plug-in it's really appreciated. Thanks. I was just wondering if you could check the 'Image Point' command, as I can't get that particular one to compile. I get a 'Could not understand command at line....' I have latest Directx, card drivers and update.

Basically the format I have is:

dword = Image Point(image number,x,y)

(though obviously I don't use 'dword' and 'image number' as variable names).

Thanks.
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd May 2010 13:24
Quote: "Great plug-in it's really appreciated. Thanks. I was just wondering if you could check the 'Image Point' command, as I can't get that particular one to compile. I get a 'Could not understand command at line....' I have latest Directx, card drivers and update."


It compiled fine with me:


So I thought I might have been using a different version of the DLL and downloaded my own file and installed it. But it still works.
In short: I have no clue why it might be doing that. Have you tried replacing the DLL again?

Cheers,
Sven B

ActionSaxon
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: United Kingdom
Posted: 23rd May 2010 18:13
Righto. I'll start sifting for possible causes. At least I know that it's my end that's at fault which is a great help. Thanks anyway for checking.

Cheers.
ActionSaxon
22
Years of Service
User Offline
Joined: 3rd Nov 2002
Location: United Kingdom
Posted: 24th May 2010 01:08
@Sven B:

I gave up looking in the end, and I'm glad I did. I reinstalled DBPro and then patched up to the latest version again and now it works. A corrupted file somewhere usually amounts to a needle in a haystack when troubleshooting a problem.

Thanks again, both for your help and for your great plug-in.

Cheers!
Todd Riggins
20
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 25th May 2010 04:16
Hi Sven, Is there no way for us to preserve the alpha channel to "pre-update" an image with the "copy image" command instead of post-updating it?

code below shows a png image with alpha bits in it, but the image will have a black background when doing the "copy image" command before the "paste image" command as shown below: [test.png attached if needed]



Ofcoarse, using "copy image" after "paste image" works. If it's impossible to fix then no worries.

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th May 2010 09:27 Edited at: 25th May 2010 09:28
Hi Todd,

I have no idea where the problem might be [edit] well I do have some ideas though... First I thought it might be a render state that DBP doesn't change when pasting the image to the screen, but pasting any other image after copy image works. So perhaps it's the other way around (my program doesn't change a render state to allows the alpha to be copied).
I will work on this but I can't give you a fix right away.

Cheers!
Sven B

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 8th Jul 2010 19:40 Edited at: 8th Jul 2010 19:44
Update

Hi everyone! It's been a while since I last updated Image Kit, but the reason is because I'm thinking of making some big changes to the plug-in (under the hood). [edit] And also because exams just ended a week ago (they went well, yay).

Features:
- I removed the 'set alpha' command. I thought you could use 'set image brightness' instead on the alpha channel, or 'set image channel'. These commands also work on render targets (set alpha only applied to normal images).
- I added the following commands:
* Treshold Image Image Number, Value, Channel
Note:
Value: if the component value is < Value, then the pixel will be colored black, else the pixel will be colored white. The alpha channel will remain the same!
Channel: Specifies the channel that will be used.
This command will work on both normal images and render targets.

* Gradient Linear Image Number, x1, y1, x2, y2, Color1, Color2, Channel, Mode
* Gradient Radial Image Number, x1, y1, Inner Radius, Outer Radius, Color1, Color2, Channel, Mode
Note:
Channel: specifies the channel that the gradient will be drawn to
Mode:
- 0 = No fill
- 1 = Fill before gradient
- 2 = Fill behind gradient
or any combination.
For now gradients only work on normal images.

[edit] I forgot an important one: The bug where paste image was broken after using any command with render targets is fixed (as pointed out by Todd Riggins).

As always, you can find the download at the first post here.

Cheers!
Sven B

Todd Riggins
20
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 9th Jul 2010 03:24
Will try it out once I re-fix my broken project! The gradient functions look useful.

Quote: "* Treshold Image Image Number, Value, Channel"


Treshold = Threshold?

ExoDev.Com |XBOX360 CONTROLLER LIBRARY|USE DARK GDK WITH LATEST DIRECTX| C2Q2.66, 8G RAM, GeFORCE 9800 X2, VISTA 64Bit
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Jul 2010 12:00 Edited at: 9th Jul 2010 12:03
Quote: "Treshold = Threshold?"


Oops... [edit] It was a typo in the keyword file (I copy-pasted it). But the actual command was using "threshold image". I'm uploading the fixed one in a moment

Sven B

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Jul 2010 16:59 Edited at: 22nd Jul 2010 17:00
Is it possible to take one image and delete part of another using it as a mask?

What I want to do is take an image from the camera which has been blurred and remove a gradually reducing amount from the centre (make it transparent), here's what I'm trying to achieve:

Images are;
TOP=Scene
MID=Mask
BOT=result

Any help would be greatly appreciated!

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 22nd Jul 2010 17:26
You should do that in the shader. Try searching for 'radial blur shader'.

[b]
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Jul 2010 17:36
Just tried searching for "radial blur shader" and nothing...

Aaah, "edge of screen":
http://forum.thegamecreators.com/?m=forum_view&t=153815&b=1

GG posted a shader! Thanks!!

Blobby 101
18
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 2nd Aug 2010 14:44
is there any chance of a command for setting an image's brightness? I'm thinking about this for Night Vision Goggles

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 2nd Aug 2010 22:30
Quote: "is there any chance of a command for setting an image's brightness? I'm thinking about this for Night Vision Goggles"

I'd use a shader. Evolved's bloom shader with no blur would give the effect you're after I think...

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Aug 2010 23:41 Edited at: 2nd Aug 2010 23:45
Before I get anymore requests ^^:

Shaders are already used to achieve the basic effects the plugin comes with. I'm even thinking about removing those effect from the DLL itself, and add it as separate files and support shaders in general.

I have searched for a way to get DBP pixel shaders (in the C++ code online), but it seems they didn't include a function to access them...
I could always keep my own list of pixel shaders, but that might cause some confusion when coding. I'm not really sure of what I should do. For now, I'm teaching myself Direct3D/X in general (not just images and how to edit them), as it might give me more insight in how things happen in DirectX.

[edit] I will be away for the next 10 days, so I won't be replying. Please be patient if you posted here .

Cheers!
Sven B

Demon000
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location:
Posted: 20th Sep 2010 21:19
Hi! I have a problem with image blending. If I do it multiple times the base image parts on the target image get darker and darker until they are black. (Image attached)

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st Sep 2010 20:15
Hi Demon000,

Unfortunately I can't give you any updates on that version anymore so I can't really look up if the problem is because of the plugin. I am working on a huge update and the old version is no more. I think I deleted the examples a while ago though, because the plugin was changing quite a bit and the examples didn't quite follow those changes. So it is perfectly possible that your example does not work the way it's supposed to anymore.

I will take this opportunity to announce that the new version of this plugin will be posted soon. The new version will include pixel shader support, and will come with a bunch of pixel shaders free to use in your projects.

Cheers!
Sven B

Demon000
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location:
Posted: 21st Sep 2010 21:12
Ok, Thanks for the answer.
Glad to hear about the new plugin, hoping to check it out soon
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 22nd Sep 2010 20:39
Would that be possible to real time manipulate an object based level's texture AND normal map, hence creating for example awesome impact effects on the ground from dropping bombs?

I'm planning on doing something like that, but till this, i could only imagine it with real time generated plains formed as the terrain, and textured as desired... Maybe leaving out the creating of an other object method would look much more awesome.

Do you have any thoughts on that Sven? (thank you for the help a couple of days before about the texture / object seams!)
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd Sep 2010 01:43
Hi Quel,

Any image can be edited as longs as its a target image, and as long as you have access to it using DBP. Luckily, you can pretty much convert any image to a target image.

Afterwards you can apply pixel shaders to any image, allowing you to make use of the GPU even for complex image operations. My last test was a Julia fractal coded as a pixel shader, and it was very fast.


(My first test run: An interactive julia fractal viewer, the time on the message box is the time it took to render to a target image of 1024x768x32)

I have now completed an utility that automates help file generation. I can now keep a list of commands with parameters and their descriptions (save/load), and it can generate all the needed html files for me. The next thing I will do is provide some examples, write some pixel shaders to go with the plugin, and then I will post it on the WIP boards.

Cheers!
Sven B

Login to post a reply

Server time is: 2024-11-24 14:13:14
Your offset time is: 2024-11-24 14:13:14