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.

Program Announcements / Image Kit V2

Author
Message
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Sep 2011 12:52
Congrats on the Valued Member status SvenB, it's well deserved!

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Sep 2011 13:26 Edited at: 1st Sep 2011 13:34
Quote: "Congrats on the Valued Member status SvenB, it's well deserved! "


Thanks! Needless to say that it makes me very happy!
Another reason for me to be building a party tonight!

[edit] BatVink,
I'm glad you got it working. I didn't know that previously allocated video memory wasn't cleared when releasing it.

Sven

MaskarenzzO
8
Years of Service
User Offline
Joined: 9th Jan 2011
Location: Brazil
Posted: 2nd Sep 2011 04:57
Great work! awesome!

The life is short, burry... steady sword!
spudnick
8
Years of Service
User Offline
Joined: 30th Nov 2010
Location:
Posted: 15th Sep 2011 00:36
Great work, and glad the memory has been sorted.

dam shame im to far away from you Sven. Would of been nice to share a few bottles with you at your party!

I'am not GOD but i can make you see again by taking my fingers out of your eyes and i can make you walk again by taking your beer away, but if you take my beer you will not walk again
ojoe73
7
Years of Service
User Offline
Joined: 24th Oct 2011
Location:
Posted: 24th Oct 2011 23:41
Hi Sven B,
can you help me, where's the download link to Image Kit V2 ???

joe
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Oct 2011 08:55
Hi Joe,

you can find the download link attached to the first post of this thread here.

Sven B

ojoe73
7
Years of Service
User Offline
Joined: 24th Oct 2011
Location:
Posted: 25th Oct 2011 18:22
oh yes, i am so blind
thx
ojoe73
7
Years of Service
User Offline
Joined: 24th Oct 2011
Location:
Posted: 25th Oct 2011 20:16
have you some idea to make a underwater Scene!?

joe
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Oct 2011 21:48
Hi Joe,

I suggest looking at some existing underwater games and see if you can come up with something. If you know some C, then pixel shaders are pretty easy to learn. Personally I don't have that much knowledge about shaders myself. I usually just go by a standard example and fiddle with it to suit my needs. The hardest things are usually the formulas to make it look good (eg. the ball effect for BatVink is basically a formula I found on the internet).

Cheers!
Sven B

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2011 10:38
Quote: "have you some idea to make a underwater Scene!?"

I spent quite a bit of time getting this working.

Full project attached.

You get a slight image distortion along the edges of the scene so you might need a border.

Attachments

Login to view attachments
ojoe73
7
Years of Service
User Offline
Joined: 24th Oct 2011
Location:
Posted: 26th Oct 2011 12:28
thx but
i think my DB has a problem

" Could not understand command at line 26. " = draw to image 69

what's wrong ???

joe
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Oct 2011 12:47
You'll need the Matrix Utility plugin too (Free and infinitely useful):
http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18

ojoe73
7
Years of Service
User Offline
Joined: 24th Oct 2011
Location:
Posted: 26th Oct 2011 13:31
thanks, great work !!!
TheComet
11
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Nov 2011 20:39
@ Sven B

Excellent plugin you made here, looks fantastic I downloaded it to give it a go, and none of your examples work for me... The program compiles and starts, but then just crashes without returning an error, just a "program stopped working, force quit" etc.

If I remove the command IK load effect, it runs. I then checked out your shader, and I noticed you're using pixel shader 3. Could it be that?

I really want to get this to work, it has just what I need for my current game in progress

TheComet

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Nov 2011 18:34 Edited at: 10th Nov 2011 18:36
Hi TheComet,

I have tried to open my project to search the code, but for some reason I can't open my project anymore (downloading my own files again doesn't work either), so I think something on my pc broke. It just says 'C:\Users\Sven\Documents\Visual Studio 2010\Projects\ImageUtilities\ImageUtilities\ImageUtilities.vcxproj : error : Project "C:\Users\Sven\Documents\Visual Studio 2010\Projects\ImageUtilities\ImageUtilities\ImageUtilities.vcxproj" could not be found.' So I have no idea what happened there, since it's saying it can't find itself...

[edit] Normally, it will use the pixel shader version specified in the shader. So you can try to alter the pixel shader itself to see if it works.

Sorry,
Sven B

TheComet
11
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Nov 2011 19:56
Quote: "Normally, it will use the pixel shader version specified in the shader. So you can try to alter the pixel shader itself to see if it works."


I tried that, but it still didn't work. The program still crashes without returning anything.

TheComet

TheComet
11
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 1st Dec 2011 09:30
@ Sven B

I got it working on my main computer, for some reason my laptop won't accept it... Do you know of a good bloom shader I can use with ImageKit ?

TheComet

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Dec 2011 10:14
Hi TheComet,

I'm glad you got it working. If you want to use a bloomshader, you might want to search for an existing one, and then strip it from its 3D parts. As for myself, I've never really used one.

Sven

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Dec 2011 10:35
TheComet,

I have only used Evolved's bloom shader in the past but all it does is take the rendered image from Bitmap 0 and apply some effects to it. Then the result is textured onto a ghosted plain. If you strip it down as SvenB suggests you'll have what you're after.

Another way to fake it is to:
1-Render to an image
2-Paste it to the screen
3-Increase the contrast
4-Blur it
5-Apply the edited image to a sprite
6-Paste the sprite with some alpha over the top of the un-altered image

That should also give you a pretty good effect. True bloom might be possible but the difference would be negligible and you could play with the sprite alpha / colour to get the effect right.

Rasdini
15
Years of Service
User Offline
Joined: 20th Feb 2004
Location:
Posted: 4th Dec 2011 02:13
I am just curious, but are the blur commands faster than those offered up in DBPro? If so, do you have an idea how much faster they are?
Sincerely,

Rich


Richard
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Dec 2011 12:21 Edited at: 4th Dec 2011 12:22
Hi Rich,

If you are referring to the blur bitmap command, then I believe Image Kit will be faster. It also has no limitation on the length of the kernel (size of the blur, which is limited to 9 for blur bitmap). DBP uses a box blur (average blur) with an FIR. Image Kit can do the same, but it is optimized more.

Apart from a box blur, Image Kit also supports gaussian blurring, either with FIR or IIR techniques.
FIR means that the filter will be slow for a large radius, and fast for a small radius. IIR means that it will be faster than FIR for a large radius and slow for a small radius.

[edit] I don't know how much faster though.

Sven B

HenriqueLuna
16
Years of Service
User Offline
Joined: 28th Sep 2002
Location:
Posted: 27th Dec 2011 00:05
Exist way extract alpha channel from image? ( put alpha image only...that work in DBpro)

that is possible with ( IK Paste Image Channel? ) or (IK Set Blend Mode?)

cause I dont know how use correctly command.

(sry case not correct threads)
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Dec 2011 09:54
Hello HenriqueLuna,

Although Image Kit can do a lot for you, the easiest way to gain access to the alpha channel is still using memblocks.
Use make memblock from image and work from there.
You can transfer the alpha channel from one image to another with Image Kit, but I think it will not be what you need (based on your description).

Cheers!
Sven B

HenriqueLuna
16
Years of Service
User Offline
Joined: 28th Sep 2002
Location:
Posted: 27th Dec 2011 18:51 Edited at: 27th Dec 2011 18:58
using Memblock dont work with extension DDS ,sure?

Thx and Happy Christmas
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 27th Dec 2011 20:22 Edited at: 27th Dec 2011 20:24
Yes, I am aware of that. But extracting the alpha channel from the .DDS compressed format isn't something Image Kit is able to do either (it was designed to operate on images, but not to retreive information from them).

In any case, Image Kit can't give you the alpha channel values directly. Maybe it would be possible using a workaround though.

- Make a bitmap that fits the image
- Clear the bitmap with a white color
- Make the image color components black by using a brightness parameter of 0.0 (you only need to do this for one component - R, G or B).
- Paste the image on the bitmap. (Optional explanation: )

The resulting color will give you the alpha value: a = 1 - C, where C is the R, G or B channel (it doesn't matter which one you choose).
Note: You will probably need to use a = 255 - C instead since color component values are usually expressed as bytes.

I'm not sure if you can turn that bitmap into a memblock to get the color values. I'm starting to lose my touch with DBP, but if that doesn't work then you can still retrieve the pixels using the point() command (or you can search for faster alternatives).

So to summarize:
Make a bitmap white
Make the image black (and be careful not to touch the alpha channel)
Paste image
Get pixel color
a = 255 - color

Cheers!
Sven B

HenriqueLuna
16
Years of Service
User Offline
Joined: 28th Sep 2002
Location:
Posted: 27th Dec 2011 21:22
dam...
however ,I understood that you said (method bitmap)

U said ..."In any case, Image Kit can't give you the alpha channel values directly"

last sign :
can show(paste) the alpha channel from image with ImageKit ?


Thx and Happy...u know
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 28th Dec 2011 08:56


Black is opaque and white is transparent.

Sven B

HenriqueLuna
16
Years of Service
User Offline
Joined: 28th Sep 2002
Location:
Posted: 29th Dec 2011 21:26
before seeing its code try and again try ,but didnt use command ik set image brightness , suck ,lol

i hate you ,perfect code sniper

I thank generosity time @Sven B
Alaror
8
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 17th Jan 2012 05:22 Edited at: 17th Jan 2012 05:23
Hey Sven B!

I'm hoping to use Image Kit to create an image for multiple tile-map layers in my 2d game, and then use that image to texture an object plain. The reasoning behind why I'd want to do this can be found in this thread where I'm looking for an alternative to the Matrix commands using a textured object plain.

To summarize, I want to create a plain that's 1536 x 1536 pixels wide, divided into a 48 x 48 tile grid. Each tile is 32 pixels wide, so I would essentially be pasting (using the command "IK PASTE IMAGE ON IMAGE") 2304 32 x 32 pixel images on the 1536 x 1536 pixel main image at every step of the program. With the code I created to test this I dropped from 60 fps to around 45 fps. To create the main image I used the command "IK CREATE RENDER TARGET," so by my understanding it should be treated as a render object instead of a regular image (this is a speed boost, yes?).

Do you believe that what I'm trying to do is reasonably possible (maintaining a consistent frame-rate of around 60) with the Image Kit plugin, or am I trying to push it beyond its intended use?

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Jan 2012 13:02
Hello Alaror,

I don't see why it wouldn't be possible. I don't know exactly what could be causing your FPS drop. It even might be that you're just trying to do too much inside the for next loop. I know that nested for loops can quickly result in a big slowdown.
I'm also not sure why you would want to redraw the whole image every loop. I'm assuming you want to have a dynamic texture. In that case, you could try to only draw the parts that need redrawing.

Also, if you're not sure about what speed to expect: I think you can compare the speed of using render targets to the one when using "paste image" on the screen.

Cheers!
Sven B

Login to post a reply

Server time is: 2019-06-16 20:10:02
Your offset time is: 2019-06-16 20:10:02