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
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st Nov 2010 17:30 Edited at: 25th May 2011 23:02
Image Kit V2 is out now!

What does this plugin do?
This plugin allows the user to manipulate images without having to convert it to a memblock, making it much faster. When using target images, you can even use the GPU to render to images or the screen with an incredible speed.

Features:
Allows you to create/copy normal and target images.
Makes it possible to manipulate channels, or render gradients on normal images.
Can paste images to the screen, or to another image.
Supports effect files (.fx) and draw images using pixel shaders.

Commands:


Most commands are quite straightforward. Along with the plugin are 2 examples included, to show how a pixel shader can be used to create a full screen effect.

Example 1: A full screen shader by rendering to an image and pasting it on the screen with an effect:


Example 2: A fractal viewer using a pixel shader:


Example 3: A showcase of some pixel shaders that do the same as some of the Image Kit commands that only work on normal images.


Attached version: v2.041b - 25/05/2011

Cheers!
Sven B

Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 1st Nov 2010 18:39
Wow, I only just noticed the WIP thread! You finished this fast.

Downloading...

OldPMan
TGC Store Seller
10
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 1st Nov 2010 22:55
I'm trying to understand correctly.
how to copy the first image in the second image and then to put an alpha channel with a third image in the second.
What am I doing wrong.

Here is my code:




Examples are not prevented, would have.

.....already beside..... for all
Dark Goblin
13
Years of Service
User Offline
Joined: 19th May 2006
Location:
Posted: 2nd Nov 2010 00:10
hey great plugin.
Is there no way to copy an image which is rendered by DBP with the "set camera to image" command into an image, of which I can get the color of a pixel by "IK POINT (Img,x,y)" ?
I really need this!

... efxMod Developer!
OldPMan
TGC Store Seller
10
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 2nd Nov 2010 09:12 Edited at: 2nd Nov 2010 09:22
Sven B show how to use your plugin right.
after (ik copy image 1,2), I can not change the Image 1.
Do not ask what I do, show how to.
Thanks.

Another question: Can I use your plug-in for commercial purposes?

Best Regards Russia

.....already beside..... for all
OldPMan
TGC Store Seller
10
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 2nd Nov 2010 10:03 Edited at: 2nd Nov 2010 11:02
Quote: "IK Replace Image Color Image Number, New Color, Source Color

Description
Use this command to convert a color to new color. This command does not work on target images. If the image is not a target image, the command will be ignored."



this is from help.
What do you mean?
command on the target does not work, but if the image does not target the command will be ignored. that is, it does not work at all? or these commands work only on the target because it does not work on normal?

.....already beside..... for all
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 2nd Nov 2010 23:07
Quote: "I'm trying to understand correctly.
how to copy the first image in the second image and then to put an alpha channel with a third image in the second.
What am I doing wrong.

Here is my code:"


Hi RUSSIA,

I'm not sure if it would be relevant, but .DDS files are by my knowledge best avoided in combination with this plugin. DDS files use a separate kind of compression, which make them impossible to use as a normal image. Several commands should work for target images, but I have not used them enough to be able to tell you which ones.

Quote: "What do you mean?
command on the target does not work, but if the image does not target the command will be ignored. that is, it does not work at all? or these commands work only on the target because it does not work on normal?"


You should visualize 2 types of images: NORMAL images and TARGET images. NORMAL images are stored in RAM memory, and can be accessed pixel by pixel by using the CPU. They support a wide range of commands just because each pixel can be accessed individually. TARGET images are different in that they can only be used by the GPU. The CPU doesn't have access to them. It makes commands very fast (because it's what a GPU is designed for), but since each pixel can't be accessed individually, several commands just can't be done for them. Well actually it is possible by using pixel shaders, which is why I added support for effect files.

Instead of resulting in an error (something like "Image is(n't) a target image") I chose to ignore the command instead. Using IanM's MatrixUtils commands you can check whether or not an image is a target image (D3DUSAGE_RENDERTARGET). His plugin also allows you to draw to an image using DBP's native 2D commands.

Quote: "hey great plugin.
Is there no way to copy an image which is rendered by DBP with the "set camera to image" command into an image, of which I can get the color of a pixel by "IK POINT (Img,x,y)" ?
I really need this!"


Thanks!
I'm sorry, but there isn't. An "set camera to image"-image is a target image. If you copy that image, then it will always stay as a target image (as it says in the help files). IK point() only works on normal images.
You can, however, unleash your pixel shaders on that rendered image, and paste it on another image or the screen.

Cheers!
Sven B

Red Eye
10
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 18th Nov 2010 16:40
This is awesome.

But is there a darkgdk version of this, I would love to see it in action in my engine!!!


Greets,

RedEye

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Nov 2010 19:00
Quote: "But is there a darkgdk version of this, I would love to see it in action in my engine!!!"


There's currently no DGDK version of this plugin. I also don't really have plans to make one. Sorry.
Maybe in the future, when I get some more free time, I'll do it.

Sven B

Sixty Squares
13
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 19th Nov 2010 03:52 Edited at: 19th Nov 2010 03:54
I just gave this a go in my game. It's great for adding bloom to a 2-player split screen game without rendering too many extra cameras-- just render each camera to an image and use IK PASTE IMAGE w/ the pixel shader.

Thanks for this!


Guns, cinematics, stealth, items and more!
Alfa x
12
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 23rd Nov 2010 01:04
Quote: "There's currently no DGDK version of this plug in. I also don't really have plans to make one. Sorry.
Maybe in the future, when I get some more free time, I'll do it."


I hope you do a DGDK version of this. I'm making extensive use of the plug-in.
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Dec 2010 13:16
Hi Sven. I was hoping to apply the effect shown in example 1 to my scene.

The problem is it's a 2D scene, is there a way to do this using your Image Kit?

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Dec 2010 14:24
Hi baxslash,

It is possible, but it might require a rewrite of your rendering code:
To achieve the effect of example 1, you only need one image and the pixel shader. In the example, the image is actually the image where the camera renders to, but in reality it can be any image you want.

So if you create a full screen target image, render to that, and then use the command
IK paste image img, 0, 0, fx
the same effect can be achieved, regardless of what you render to the image.

Rendering to an image is actually quite easy. If you have IanM's MatrixUtils, then you can redirect all DBP's 2D commands to a render target image (it should be compatible with an ImageKit target image). Additionally, ImageKit also allows much more functionality to paste images to another image.

Cheers!
Sven B

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Dec 2010 10:11
Quote: "If you have IanM's MatrixUtils, then you can redirect all DBP's 2D commands to a render target image (it should be compatible with an ImageKit target image)"

I do have Matrix Utils, I'll take a look and let you know how I get on, Thanks!

Just one question, what is the FX file used for this effect?

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Dec 2010 13:35
Quote: "Just one question, what is the FX file used for this effect?"


It's called Distortion.fx, using technique "Mapped". The map image can be set by using

IK set effect texture fx, "g_Map", img

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Dec 2010 15:16
Thanks Sven, just trying to get this thing working now and I have this for loading the effect:


...and the following in my loop:


But I just get a black background not the image I want to distort... distorted.

I tried pasting it without the effect and still nothing, if I paste it offset by 100,100 it pastes a black rectangle in from 100,100 to the edges of the screen...

It might be I'm using the Matrix Util stuff wrong but I don't know. Any ideas?

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Dec 2010 18:20
Hi baxslash,

Here's what I meant:


Left mouse button to draw
Right mouse button to randomize color

IanM's 'draw to image' disables drawing to the screen. So you have to change back to 'draw to bitmap 0'.

Good luck
Sven B

Stab in the Dark software
Valued Member
16
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 12th Dec 2010 21:53 Edited at: 25th Oct 2011 14:44
Really Nice work


[img][/img]


WindowsXP SP3,Vista,Windows 7 SP1, DBpro v7.7RC7
Stab In The Dark Editor
The coffee is lovely dark and deep,and I have code to write before I sleep.
baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Dec 2010 10:01
Hi Sven, thanks! I actually got it working on Friday just like you showed it.

I'm going to make a demo of this for the code snippets board as I think it's a really easy method for implimeting fullscreen shaders to 'parts' of a 2D game. What I mean is you could apply this to your background (including moving scenery like fish swimming past) and then render your forground on top.

I'll post a link when I've had time for the demo.

Here's a link to the thread I started for this problem:
http://forum.thegamecreators.com/?m=forum_view&t=178800&b=1

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Dec 2010 19:13
Stab in the Dark software,

Thanks!

Quote: "Hi Sven, thanks! I actually got it working on Friday just like you showed it."


You're welcome. I'm looking forward to your game, as it'll probably be the first one I know where it'll be actually used in.

Cheers!
Sven B

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Dec 2010 09:48 Edited at: 16th Dec 2010 14:24
Quote: "I'm looking forward to your game, as it'll probably be the first one I know where it'll be actually used in."

It might only make it in as an advanced graphics 'option' as it runs at around 15-20fps on my mid-high end netbook but it'll definitely be a feature.

Thanks for your help and for this great plugin!

EDIT: I may have fixed the framerate problem so it might yet make it in the 'normal' graphics setting. Demo soon of seven+ levels including at least 1 water level.

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Jan 2011 22:59 Edited at: 3rd Jan 2011 23:10
Update

Quite a long list this time:

[v2.02]
- Changed Target Image to Render Target to avoid confusion with DirectX's terminology and
IanM's MatrixUtils.
* IK Create Target Image is now changed to IK Create Render Target
* All help files should now mention render targets instead of target images.
- Updated the help files with more information about render targets and compatibility. (See Introduction)
- Made ImageKit return an error if a command isn't compatible with render target/normal images.
- Fixed a few minor errors in the keywords file parameter list.
- Introduced new commands:
* IK Copy/Convert To Render Target
* IK Is Render Target()
- Changed parameter order for IK Paste Image Channel. It is now the same order as IK Paste Image On Image (which
seems more logical too).
- IK load effect no longers crashes after returning the compilation error.
- In some cases, ImageKit can detect a lost device and will return an error that you should use Reset Image Kit
- Fullscreen Exclusive mode still doesn't work when changing display mode. I'm still researching on this.

It's probably a little too late to start changing terminology, but I decided it'd be best for future users if they want to combine the plugin with IanM's MatrixUtils plugin.
So the biggest changes are probably the commands that changed: ik create render target, ik paste image channel - I'm sorry about that, I hope it won't cause too much confusion - and the fact that ImageKit will return an error if the command is not compatible with that type of image.

I have tried to write an introduction in my best English, explaining the difference between a normal image and a render target.

Finally, I will see what I can do about the last point. Fullscreen Exclusive seems to be a bit of a special case...
As always, I'll be updating the first post with the download in a second.

[edit] Finished.

Cheers!
Sven B

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 4th Jan 2011 14:14 Edited at: 4th Jan 2011 14:17
It seems that full screen exclusive mode does work when changing display modes. The only thing you have to do is use the command IK Reset Image KIT just <before> Set Display Mode.

[edit] Oh, and if anyone finds mistakes in the help file, or any bugs you can find, please report here.

Cheers!
Sven B

MonoCoder
13
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 6th Jan 2011 18:14 Edited at: 6th Jan 2011 18:21
Hi, Sven B. I'm having some trouble and was wondering if you could help.

What I'm after is a masking effect; one image drawn in an area determined by the alpha of another. I have this code (lua):



the functions in DBP (commented stuff is just some things I've been trying which I've left in):



What this should do is:

- make a pair of empty 192x192 images, img1 and img2;
- paste the alpha channel of the "fill" image into img1;
- paste the alpha channel of the "mask" image into img2;
- set blend mode to multiply, and paste the img2 (mask) alpha on to the img1 (fill) alpha to create the final alpha;
- set blend mode back, then copy the fill image's rgb channels over to img2, which will now be used for the finished image;
- place the final alpha onto the image.

The reason for all this (probably misguided; at least, certainly I'm doing something wrong as it still doesn't work >_> ) backing and forthing is because when trying to paste one image's alpha channel directly onto another's, the multiply blend mode doesn't seem to work, and in the image, the alpha channel seems to have been reduced to either transparent or visible (that is, it looks as though all the greys have been reduced to black/white).


I've been looking this over for hours so I'm pretty confused myself. Am I doing stuff wrong or is there a bug with pasting image channels?


Ta
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Jan 2011 18:22 Edited at: 6th Jan 2011 18:23
I will look a bit deeper into this in an hour or so, but I can see that you've written:

IK Paste Image Channel onImg, fromImg, onChannel, fromChannel, x, y

Whereas since the last update, I've changed:
Quote: "- Changed parameter order for IK Paste Image Channel. It is now the same order as IK Paste Image On Image (which
seems more logical too)."

[edit] I've checked, and the help files should be updated...

I'm really sorry for this. I've wondered if I'd do this or not. But in the end I decided to do it. So sorry for the inconvenience...

Cheers!
Sven B

MonoCoder
13
Years of Service
User Offline
Joined: 4th Dec 2005
Location: england
Posted: 6th Jan 2011 18:23 Edited at: 6th Jan 2011 18:26
I've not updated to the latest one yet; I'm still using the older one in which the order I'm using is still right

Early thanks for looking at it, and for prompt reply!

(edit: I would've updated already, but didn't see a fix for this so I figured I'd try for solving this before updating)
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 6th Jan 2011 18:40
Ah yes, I think I know what's wrong.

The problem is that IK Paste Image Channel doesn't work with blend modes. Blend modes were intended to be used only with IK Paste Image (on image) and variants.
Currently, I'm still deciding what to do with that (I either say it doesn't work that way in the help files, or implement it as a new feature in the next version).

How about using the Red channel first for example. If I understand correctly, you want to perform some kind of logical AND operation on the mask and fill images. If you use opaque images for the fill and mask images (so using gray-scale images), then you can perform a multiply operation on them before copying it to the alpha channel of img1 and img2.

Cheers!
Sven B

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Jan 2011 17:32
(Small) Update

[v2.03]
- Changed internal system a bit, making IK Reset Image now obsolete. The command is still there
for compatability reasons.

Thanks to Diggsey, who showed me a slightly different way with a better performance.

Cheers!
Sven B

=PRoF=
16
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 24th Jan 2011 10:27 Edited at: 25th Jan 2011 09:59
@Sven B:

I have recently started using your Image Kit plugin to quickly make the graphics for a UI system I am developing.

I also recently updated DBP to the 77b version.

Sadly, My code no longer works

I have narrowed it down to the following command.



Here is a snippet to show my findings.



This code runs fine on my 7.5 install, but causes an error "Could not create internal image" on my 7.7b install.


>Edit<

I have fixed the problem temporarily by replacing all the "IK Resize Image" commands, with "IK Create Render Target" commands, and it once again works

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Jan 2011 20:28
Hi =Prof=,

I've only tested the plugin with 7.6. I'll try upgrading to 7.7b later and see what's wrong.

Cheers!
Sven B

kamac
8
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 25th Jan 2011 20:47 Edited at: 25th Jan 2011 21:14
Oh God! That looks fantastic!

I will use it for sure!

*downloading*


Edit@

x_x Can't get it to work, DBPro doesn't sees the new commands...

Edit2@

Lol... wrong folder...


Edit3@

Hmm.. It works too slow for my game . I get around 5 fps'es just trying to flip the image.

In progress of making Archery Simulator... Or maybe not simulator x]?

@There'll be a sig @
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Jan 2011 21:43
Quote: "Hmm.. It works too slow for my game . I get around 5 fps'es just trying to flip the image."


The speed depends on the image size (especially when using normal images) and whether or not it's a render target. If you're looking for real-time image editing, then I suggest you use render targets instead.
Although Image Kit is faster than using memblocks, it can't do the impossible. For normal images, each pixel still has to be processed individually. Render targets are much faster because they use the GPU to process, but they're also kind of limited (I'm thinking of blurring images).

Cheers!
Sven B

kamac
8
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 25th Jan 2011 22:30
Well, thanks There are two things for me that i really want from your Image Kit.
1st Is blur - Great Thing
2nd Is that white-black image shader Great for cut-scenes.

In progress of making Archery Simulator... Or maybe not simulator x]?

@There'll be a sig @
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 28th Jan 2011 11:57
Quote: "This code runs fine on my 7.5 install, but causes an error "Could not create internal image" on my 7.7b install."


Hi =Prof=,

I've tested the plugin using 7.7b and I couldn't reproduce the error. Do you have the latest version of both 7.7b and Image Kit? I will look a little deeper into this.

Cheers!
Sven B

=PRoF=
16
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 28th Jan 2011 23:06
@Sven B:

I updated my other PC to 7.7b (rc2 this time tho) and the problem doesn't seem to happen.

I will update the 1st PC to 7.7b rc2 and see if it still happens. I think it might just be a problem with my laptop tho

Sorry if it's a false alarm

The Slayer
Forum Vice President
9
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 3rd Feb 2011 18:19
Hi Sven B,

Good job on your plugin!
I was wondering though, would your Image Kit be suited to do animations?
I'm trying to make an adventure game in 2.5 style, and I need a way to animate (loop) the images for the different scenes in the game.
Suppose I have 6 images for one scene (all 1024x600 in size) and I want to loop them to have background animation, could that be done with your plugin, and if so, how would you do it?
On top of the animated background, I'd like to have sprites and/or 3D models (for characters and other things). Is this doable with your Image Kit?
Thanks!

Cheers

SLAYER RULES! YEAH, MAN!!
Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 3rd Feb 2011 20:19
Hi The Slayer,

As far as I know Image Kit draws like a normal 2D command. If you wish to draw 3D and sprites over it, you can probably use draw to front/back. If you just want to paste the images to the screen, then DBP's paste image should be enough. If you wish to resize the images, or apply pixel shaders to them, then Image Kit should do the trick.

Sven B

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Feb 2011 13:19
SvenB, is there a quick way to get the colour of a 'point' on the screen that's quicker than using DBP's "Point" command using your plugin?

I tried a couple of things but couldn't get it working any quicker. It's for a spheremap render engine I use in my SkyBox/SkySphere maker 'EnviroScope'. Trying to speed it up a little...

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Feb 2011 18:41
I'm afraid not. Image Kit focuses on images and not the screen. Also, if anything, the screen is basically a render target, and the plugin can't retrieve a point from a render target simply because the CPU doesn't have access to its data.

Sven B

baxslash
Valued Member
Bronze Codemaster
12
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Feb 2011 09:25
Quote: "I'm afraid not. Image Kit focuses on images and not the screen. Also, if anything, the screen is basically a render target, and the plugin can't retrieve a point from a render target simply because the CPU doesn't have access to its data."

I kind of figured that after a few more tests but thanks for confirming it.

Takes ages to render a spheremap using "point"...

Admiral MH
8
Years of Service
User Offline
Joined: 10th Feb 2011
Location: TX, USA
Posted: 10th Feb 2011 17:57
Sven B,

Really nice plugin. I like the pixel shaders and your demo programs looks really good.
Todd Riggins
14
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 15th Feb 2011 23:37 Edited at: 15th Feb 2011 23:43
Hiya

I finally got back with working with Image Kit again and having a problem with the IK gradient linear command.

For simple testing, I want to have my png image with a vertical linear gradient from white at top to a dark gray at bottom. I just can't figure out how it works.

When I want a specific gradient color like for example
RGB(0,118,163)
to
RGB(0,39,84)

I would assume I would use:
IK Gradient Linear myImage,0,0,0,31,0,0,CHANNEL_RED,3
IK Gradient Linear myImage,0,0,0,31,118,39,CHANNEL_GREEN,3
IK Gradient Linear myImage,0,0,0,31,163,84,CHANNEL_BLUE,3

Seems like the blue channel only effects the image with that.
Can I not mix match color channels to get the color I want?
Thanks for any help.

Code:


ExoDevCom1.png


ExoDev.Com - A Game Development Community Website! Featuring: XBOX360 CONTROLLER LIBRARY

Attachments

Login to view attachments
Rich Dersheimer
AGK Developer
9
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 17th Feb 2011 04:41 Edited at: 17th Feb 2011 05:29
Sven - I'm looking for a way to change the hue of an image, similar to SET SPRITE DIFFUSE. Can I use IK SET IMAGE CHANNEL for that? I'm not sure what a "channel" is, and what DWORD would be associated with it.

EDIT: Aha! IK SET IMAGE BRIGHTNESS works for what I'm doing! But I'm still curious what IK SET IMAGE CHANNEL is used for.

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Feb 2011 22:45
Hi Todd,

The channels used in the gradient are basically a mask. In other words, you just need to do this:



Rich Dersheimer,

You're right, IK Set Image Brightness achieves the same effect as a sprite diffuse. IK Set Image Channel sets one channel to a specified value between 0 and 255.

Cheers!
Sven B

greenlig
15
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Melbourne
Posted: 7th Mar 2011 02:55 Edited at: 7th Mar 2011 05:38
Hi Sven B,

Your plugin looks great, and seems to be what I am looking for. In your old post, you had an example with the bullet holes making transparent areas on a plane? How would that be achieved with your current system? I want to make something similar to dig-dug/lemmings, and have been scouring the forums for some way to achieve this.

Any help would be fantastic!

EDIT - Bashed my way through it and got it working Thanks heaps for the awesome tool kit!

Regards,
Greenlig

Your signature has been erased by a mod as it is far too big.
GIDustin
11
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 10th Apr 2011 04:38
I need to resize an image cleanly and keep the transparency intact. When I resize with mode 0, it doesn't look great, and with mode 1 it is completely transparent. Am I doing something wrong or is resizing partially transparent images just difficult?

miso
9
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 13th Apr 2011 04:17
Hello all!

Is there any (fast) way to clear an image without deleting and recreating it?

(I want to render only a graphic mouse cursor onto an image for some reason, and I dont want it to leave a track.)

No place like 127.0.0.1 .
thenerd
10
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 13th Apr 2011 04:54
Adding to miso's post, a command that would work just as well as clearing an image would be a command to fill the entire image with one color or alpha value. I've tried to use SET IMAGE CHANNEL and similar, but those are too slow to be practical.

Sven B
14
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 15th Apr 2011 19:20
Hello everyone,

Quote: "I need to resize an image cleanly and keep the transparency intact. When I resize with mode 0, it doesn't look great, and with mode 1 it is completely transparent. Am I doing something wrong or is resizing partially transparent images just difficult?"


Hopefully, this update will suit your needs.

Quote: "Is there any (fast) way to clear an image without deleting and recreating it?"


That depends. The fastest way is having a render target image combined with IanM's plugin to draw to that image (and using cls). I could add a command that deals with clearing the image explicitly, but it would only work to clear the image with a black transparent color. Any other color probably won't be faster than the ik set image channel command.

Quote: "I've tried to use SET IMAGE CHANNEL and similar, but those are too slow to be practical."


Operations on normal images are (usually) too slow to be used in real time. However, they're probably faster than using memblocks.

Update v2.04
- Added a new mode to IK Set Color To Alpha.
- Fixed IK Set Image Channel for render targets.
- Added linear resize mode to IK Resize Image for normal images.
- Hopefully a fix for those who got the "Setup Debug DLL could not be loaded." Error.

Cheers!
Sven B

miso
9
Years of Service
User Offline
Joined: 16th Jun 2010
Location: Budapest, Hungary, 127.0.0.1
Posted: 15th Apr 2011 19:45
Quote: "The fastest way is having a render target image combined with IanM's plugin to draw to that image (and using cls)."


Im already using it for the render, but that obvious solution wasn't in my mind. Thanks.

No place like 127.0.0.1 .

Login to post a reply

Server time is: 2019-06-25 03:02:23
Your offset time is: 2019-06-25 03:02:23