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
thenerd
15
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 15th Apr 2011 21:46 Edited at: 15th Apr 2011 21:47
Quote: "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."

Actually, that's exactly what we need: to clear the image to a black transparent color.
I've tried using cls, but it seems to be too slow.

By the way, miso and I are actually both talking about the same thing, we were working on it together.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Apr 2011 14:03 Edited at: 16th Apr 2011 14:08
Quote: "Actually, that's exactly what we need: to clear the image to a black transparent color.
I've tried using cls, but it seems to be too slow.

By the way, miso and I are actually both talking about the same thing, we were working on it together."


I don't think you'll get much faster than that though... The thing I was talking about was for normal images. Render targets will be faster, even if I would implement that command.

[edit] I said something before about ik set image channel. But I wanted to add that you can improve the speed of this command for render targets by using a custom pixel shader. The command does not use pixel shaders, and therefor needs multiple rendering passes to get the result. Using pixel shaders, you can do this all in one pass and so it is about 2-3 times faster.

Good luck,
Sven B

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 1st May 2011 15:18 Edited at: 1st May 2011 15:33
Update

[v2.041]
- Sometimes DBP crashed when Image Kit raised an error. Fixed.
- Updated the help files with more information.

Download at first post.

Sven B

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 1st May 2011 18:29
Sweet.

Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 7th May 2011 17:31
@ SvenB - anything you have done (with Image Kit and/or Image Kit and Shader) to create lens flares?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th May 2011 21:07
Quote: "@ SvenB - anything you have done (with Image Kit and/or Image Kit and Shader) to create lens flares?"


Not really. Perhaps I might give it a go in the future.

Sven B

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 19th May 2011 16:08
Sven B, I am getting some strange effects from a render target image.

Here is the code I use to move my camera to a new location, and render that location to an image.

The problem I get is that some faces are showing that should be behind other faces.

Attached is an example of how this is implimented so you can see the problem. Just right click and look around the room as it changes...

Attachments

Login to view attachments
Jimmy
21
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 19th May 2011 19:56
First of all, cool effect. I'm excited to see where you're going with this.

Secondly, the only thing that comes to my mind is that you have object culling on, so while you're rendering that image, those faces on the other room are being culled based on the camera's final state before syncing, or possibly after syncing.

Just a theory, though.


May 10th / Jerico2day-OBese87 / VOTE NOW
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th May 2011 21:43 Edited at: 19th May 2011 22:06
I'm having issues on Windows 7. Using your latest version of IK and just updated to DBP 7.6 (most recent shown in the downloads, though I'm confused why some of you have said you're on 7.7b). I keep getting the following error: "Could not create an internal image".

The same code works fine on XP-32 but not Win7-64. Even get the error when I try running the XP-compiled version on Win7.


It seems to be a problem whenever I call "IK Resize Image"

=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 19th May 2011 22:26 Edited at: 19th May 2011 22:33
@Phaelax:
I have Image Kit running fine on my Windows 7 64bit install. I am also using the 7.7beta update. Could you post some code so I could test what you are trying to do?

7.7beta is available for download in the sticky at the top of the DBPro Board.

>Edit<

Didn't see your edit, I shall test a snippet now.

>Edit 2<

I just ran this code...



It just draws some random boxes, grabs the image and resizes it. I tried it with a few different resize modes and they all compiled and ran fine.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th May 2011 00:29
Your example ran fine, but mine still isn't. I stripped it down as much as possible while still being able to duplicate the problem.

I forgot to mention I'm using the image distortion effect. My demo obviously won't display anything without the images, but I'll assume it works as long as no error is thrown.



baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 20th May 2011 10:28
Quote: "First of all, cool effect. I'm excited to see where you're going with this."

Thanks. It's something I'm working on with darkvee (he did most of the 'portal' effect).

Quote: "Secondly, the only thing that comes to my mind is that you have object culling on, so while you're rendering that image, those faces on the other room are being culled based on the camera's final state before syncing, or possibly after syncing."

I'm not changing the culling state between the two sync's though, it's confusing.

I'll experiment a little more...

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 21st May 2011 16:10
Baxslash,

Image Kit has nothing to do with how DBP renders to render targets. So I don't think I can help in that area.

Phaelax,

I can run your example without resulting in an error (though it just gives a black screen since I don't have the images so I can't see if it should do what it's supposed to do).
The error is caused when Image Kit tries to create a temporary image and it fails. In your case, the 'extra' image is a render target. The reason that =PRoF='s code works, is probably because it creates a temporary normal image instead of a render target.

Could you try using the resize command on a render target and see if it results in an error? If it doesn't, then it might mean that it's the combination of using effect files and IK Resize Image.

On a side note: As I have said, IK Resize Image creates a temporary image, so it isn't really suited for using it several times in a loop. By using two separate render targets, you can increase performance by rendering from one to another and using IK Paste Image Img, Left, Top, Right, Bottom, Effect. Using this method, Image Kit doesn't have to create and release a temporary image every time you call IK Resize Image.

Cheers!
Sven B

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd May 2011 00:06
I adjusted my code to use your suggestion with paste image. Guess I should've read the help file more closely, I didn't know I could resize the image on the fly when pasting it. But you're right, it tripled the frame rate; went from about 350fps to 1000fps. Not a huge deal for me, I cap it at 60 anyway. But more importantly, it works on Win7 now.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd May 2011 10:23
Hi Phaelax,

I'm glad you got it working.
If you have some time, I'd like you to see if you can get the following commands working with render targets:
IK Convert To Render Target
IK Flip Image (Horizontally/Vertically)
IK Set Image Channel
IK Dot

They all create a temporary image and can potentially give the 'Internal image could not be created.'-error.

Sven B

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd May 2011 10:48
Quote: "Image Kit has nothing to do with how DBP renders to render targets. So I don't think I can help in that area."

Thanks Sven, but how can it have nothing to do with it? Are you saying DBP renders differently to render targets? I'm not very knowledgable about this side of things...

This is kind of vital to the usability of your render target commands for 3D games. I don't suppose you know who might be able to help with this (assuming you can't)?

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd May 2011 17:31
Hi Baxslash,

DarkBasic Pro doesn't discriminate between render targets and the screen, so if you get the right result without rendering to the image, then I assume it should work with a render target as well. Image Kit doesn't 'change' DBP in any way, it can just do things with render targets that isn't built in.

Also, your code:


doesn't have an Image Kit command in it. It has IanM's MatrixUtils and D3D commands though.

Sven B

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 23rd May 2011 17:39
Quote: "Also, your code... doesn't have an Image Kit command in it. It has IanM's MatrixUtils and D3D commands though."

You're right, that part doesn't but I used IK:



To set up the image. I thought I was using IK to draw to the render target but obviously not. I changed it quite a few times whilst trying to get rid of this problem...

What IK commands would you suggest using instead?

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 23rd May 2011 20:30
Hi baxslash,

I think I know what I meant to say You see, render targets aren't something unique to Image Kit. It is a functionality built in Direct3D that DBP hasn't paid much attention to. Even if you don't have Image Kit, your program will still use render targets, but it isn't named like that.

If you use the command Set Camera To Image in DarkBasic Pro, then the image is automatically converted to a render target. But, this is the only part of DBP that uses render targets (which is a shame) so that's why there's Image Kit. Even IanM's plugin: IK Create Render Target does exactly the same as writing Make Image using IanM's MatrixUtils (plugin 33) with the D3DFMT_A8R8G8B8 format (in fact, if the creation command is the only thing you're using Image Kit for, then it might even save you some executable byte size by using IanM's version instead).

As a summary:
DarkBasic Pro can render 3D to a render target
IanM's plugin can redirect other rendering commands of DBP to a render target (like 2D commands and paste image)
Image Kit can manipulate render target images and apply pixel shaders to them. Also, it has more options on how to paste images on a render target.

So in other words, Image Kit can't do difficult things like messing with DBP's rendering pipeline. It is used for applying imaging operations to normal and render target images. Like applying some kind of cool effect after everything has been rendered by DBP. If you have faces before other faces that shouldn't be there, then it would indicate that there's something wrong with how DBP is rendering it to the render target, but that area is out of reach for Image Kit.

I hope I explained it well.

Sven B

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 24th May 2011 10:38
Thanks @SvenB, I think I understand a little better what is happening now. I thought that there might be something in the way the render target image was being created that might affect how it is rendered (like maybe if it was directed to be drawn by the CPU or something) but your explanation clears that up for me. I guess I might have to revise the effect a little...

Thanks again. Your knowledge has been a huge help to me on many occasions!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 24th May 2011 16:06
I'm glad my explanation was a little more understandable. I still have some troubles explaining myself in English every now and then, but just be patient with me until I find the right words and we'll be fine
Also, I personally think it's a good thing that I'm getting feedback about possible bugs about Image Kit (even if you're not sure that it is because of the plugin).

Cheers!
Sven B

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th May 2011 08:38 Edited at: 25th May 2011 09:10
Here's a code snippet that throws the error "Could not create an internal image".



Now here's the weird problem. Originally I was running this on my laptop with Win7-64. I booted up my desktop running Win7-64 and that code above works just fine. Both systems are up to date and have admin accounts. The only difference I see (aside from hardware) is that my desktop has Win7 installed on drive W: while the laptop install is on C.


Here's the example I used to flip a render image:


Again, this works on my desktop but not my laptop. It'll run, but soon as I hit the rightkey to flip the image, I get the same error. It appears there's something with my laptop that doesn't like your plugin. Maybe a graphics card issue? If I use the commands on a non-render target then they work fine on both systems. So it's definitely something to do specifically with render targets and my laptop.


Also, as I'm using "draw to image" from Matrix1 library, does your plugin include a compatible command?

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th May 2011 11:10
Hi Phaelax,

I will send you an email regarding this issue.

IanM's Draw To Image will enable you to draw with DBP commands to a render target. Image Kit can only paste images to other images. Search the help files for the commands IK Paste Image On Image (Rotated). I'm not sure if this is what you meant with being compatible.

Cheers!
Sven B

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th May 2011 20:28 Edited at: 25th May 2011 20:40
Nah, I was looking for a command to redirect drawing to an image just as Ian's does so I wouldn't need my app to compile with Matrix1 dll for just a single command. Oh well.

I received your email, I'll respond in a few minutes.

Ok, I sent an email back.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th May 2011 22:59
Hi Phaelax,

Thanks for testing. It turns out that it was a problem with the number of levels of the texture that were created along with the image. And so, we have the update:

Update

[v2.041b]
- Fixed a bug that made the program crash for some graphic cards when creating a temporary internal render target.

Rather a small update, but bugs are bugs and you should get rid off them as soon as possible As always, I'll be updating the first post in a second.

Cheers!
Sven B

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Aug 2011 16:54 Edited at: 8th Aug 2011 16:55
I'm wondering if I can achieve the following using this image kit:

1. Create a 2D image that looks like a 3D Sphere, as in the image. For this I presume I need a new "technique" in the distortion fx file? I don't know the algorithm that achieves this and struggled to find any fx code that does this.

2. Can I take a snapshot of the resulting image? That is, once I have the effect I take a static version of it so I can paste it without needing the fx file.



Attachments

Login to view attachments
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 8th Aug 2011 17:12
Batvink, is this thread any use to you?
http://forum.thegamecreators.com/?m=forum_view&t=170392&b=6

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Aug 2011 17:48
That looks quite relevant, although my knowledge of pixel shaders is too low to comprehend how I would use it. If I can somehow lift part of it and use it with IK then it's a winner. I have 2 uses:

1. single image (writing on a ping-pong ball), this will become a static image, this is the IK requirement.

2. Rendering a portion of the screen (looking into a glass bowl). This is dynamic as it will be continually animated. I don't know if this needs IK or not.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Aug 2011 13:42
Hi BatVink,

This is the closest I could get to your effect:
Lens.fx


Example DarkBasic Pro code:


Cheers!
Sven B

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Aug 2011 16:20
Thanks Sven, that's very close to what I need. The effect is actually too much, I am looking for much less than this, but I couldn't work out how to reduce the distortion. I played with the values of k and zoom, but the sphere ended up being smaller or bigger.

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Aug 2011 16:51 Edited at: 13th Aug 2011 16:52
I actually used some formula I picked up from somewhere on the internet. In any case, if you want to reduce the effect, you could use:

float f = (1 + Amount * r2*(k + sqrt(r2))) / zoom;
The lens effect will decrease as you let Amount go to 0.0.

Sven B

[edit] Of course, you'll need to add another global variable Amount beside k and zoom.

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Aug 2011 20:24 Edited at: 13th Aug 2011 20:24
Thanks Sven, I tried playing with this idea but it doesn't work. The image below, including the white square, are values of 0.0, 0.5, 1.0, 2.0 and 10.0



Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Aug 2011 20:55 Edited at: 13th Aug 2011 20:57
The first white image is because the zoom is too high.
If you wish, you can alter the values using this little snippet:



[edit] Controls are:
Q/A to change k
W/S to change amount
E/D to change zoom
(I hope I'm right. I have an azerty keyboard)

Lens.fx:


You could also completely change the shader function of course. This part takes care of the vector transformation:


And a full list of available HLSL functions can be found here.



Sven B

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 13th Aug 2011 22:56 Edited at: 13th Aug 2011 22:56
Sven you are a genius, I have exactly what I need now.
The Amount is what is needed to change the spherical effect, and then zoom and k are used to resize the result. Many thanks!
I didn't realise that the values could be passed in to the fx file either, that has saved me hours of recompiling



Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 15th Aug 2011 11:47
That's great! The result looks very nice.
Good luck on your project. If you have any questions about Image Kit you can always pop up here again. I don't really browse the forums anymore but I'll still check my own threads.

Cheers!
Sven B

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Aug 2011 19:18
I am trying to work out how to achieve this, and I may need a render target but not quite sure.

I have 3 images:

1. A sphere
2. An overlay image
3. The result - Sphere plus overlay.

Image 1 is loaded from a file
Image 2 is created in code.
Image 2 is Image 1 + Image 2, put together in code

When Image 3 is complete, it must have an exact copy of image 1, and a copy of image 2 that has a distortion effect applied to it.

I think I need to use IK PASTE IMAGE to paste with the effect, but how do I know what I am pasting to?

Thanks again for any help!

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 17th Aug 2011 22:50
Hi BatVink,

For pasting you can use 2 families of commands:
IK Paste Image
IK Paste Image on Image


As a summary:
For IK Paste Image the type of image does not matter.
For IK Paste Image On Image the target image has to be a render target if you wish to use effects. In any other case the type of image does not matter.
Of course, when pasting on a render target you will have a better performance in terms of speed, but if speed is not an issue then interfacing to a render target might be too much trouble. And then there's the issue of available video memory.

In your case it kind of depends how fast you want to make it. First of all, I would like to say that you could do this in a number of steps using the basic Image Kit commands. The first issue is how often this process has to be repeated.

If it has to be repeated every loop, then it is definitely the fastest if you're using a shader. You can assign the overlay image to a second sampler in the shader. Then you can paste the sphere image using IK Paste Image (on Image) - depending if you want to render it directly to the screen or to an intermediary render target (image 3) - with an effect. You have full control on the coordinates on the image (for the distortion effect) and full control over the blending algorithm (putting them together) once you retrieved the right pixels on the images. Downside is that you'll need some knowledge about pixel shaders...

If speed is less crucial, then you have a number of option. For the distortion effect you can use memblock manipulation instead of a shader so that the overlay image doesn't have to be converted to a render target. It would also be best to alter the alpha channel of the overlay image during this step, so that the parts beside the sphere aren't affected when pasting. Once you have generated your overlay image using the distortion effect, and once you have the right alpha channel for your overlay image you can use IK Paste Image On Image and IK Copy Image to generate the combined image 3.

Quote: "I think I need to use IK PASTE IMAGE to paste with the effect, but how do I know what I am pasting to?"


I'm not sure I understand the question, but here goes:
You can find the type of image using IK Is Target Image(). An image is almost always a normal image to start with (except for set camera to image-images). You can also check the help files for more information on which commands you can use. The index is somewhat categorized to make it easier to read, and the green letters behind each command indicate whether or not the command works with normal images (N) or render targets (R).

I hope it helps.
Sven B

Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 18th Aug 2011 00:46
@Sven B:

Final Fantasy XIII?

I am already using your ImageKit plugin in my new game

Clonkex

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Aug 2011 10:08
Quote: "Final Fantasy XIII?"


Yeah FFVII to FFX were the best RPG's ever (especially FFX)! FFXIII had very good graphics, but you had to read too much to understand the plot. The avatar is from the time I was waiting for FFXIII to come out. And then I never changed it because it would just be more confusing for others.
Great that you're using this plugin.

Good luck with your project!
Sven B

Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 18th Aug 2011 10:35
Ok....background time....

My brother and I bought Dragon Quest: The Journey Of The Cursed King (I think it's DQ VIII). We had had no previous experience with that sort of game at all, but when we bought our PS2 (we were about 12 and 13, I think), it came with a demo disc with demos of various games (among them, Black, one of the Tomb Raider games, and DQ VIII). And then one day we were in Kmart with some extra money and happened open DQ VIII. We had loved the demo so much we instantly bought the game.

We spent many mornings before school with our three younger sisters watching us play it (we are homeschooled, and Mum was being nice and letting us start school late). Basically everyone played it, except our youngest sister. I was Yangus, my brother was the main guy (who was named Both because we named the save file that and didn't realise it also named the guy), our oldest younger sister was Angelo, and our second-youngest younger sister was Jessica. We each told whoever was controlling it what we wanted our guy to do.

Anyway we are a few years older now and just recently my brother and I bought a new Xbox360. And now we are considering buying Final Fantasy XIII, mainly because it's made by Square Enix, the people that did DQ VIII. And we absolutely LOVED DQ. We still haven't found enough MetalSlimes to level-up our characters enough to finish off whichever dragon we're fighting right now, but we have finished the game - we're just stuck on the extra go-back-in-time-slightly-and-do-this-extra-quest part.

ANYWAY, is FFXIII worth buying on the Xbox?

Sorry for the long, completely off-topic post

In regards to Rift, I've nearly got the portals completely working, then I'll add the editor GUI using TopGUI and post the source and demo

Clonkex

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 18th Aug 2011 23:36
Quote: "ANYWAY, is FFXIII worth buying on the Xbox?"


I have the version on the PS3. I will quickly sketch the ups and downs of the game:
+ I kind of like the game system. It's also cool that characters can 'learn' during battle (like elemental weakness etc.)
+ The graphics are very nice.
- The story is rather complicated. The story doesn't start with a "main player wakes up" or "main player gets dragged in another world", etc. So instead you get left with a whole bunch of texts to catch up on the story. And more text to read after each cut scene (which are beautiful though).
- I got kind of annoyed that it was nearly impossible to grind. Monsters are at set positions on the field and don't respawn (or in any case too slow to grind, you need to change fields to make them respawn IIRC).
It's still a good RPG, but I have yet to discover an RPG that compares to FFX...

[/OffTopic]

Your Rift game looks pretty nice. I like the portal effect. What are you using Image Kit for?

Sven

Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 19th Aug 2011 00:24
Quote: "grind"


What's grinding? Is that running around in circles so you'll start a fight with monster to get XP? We used to do that with DQ.

Quote: "IIRC"


As you can see, while I do love RPGs, I'm not familiar with most of the terms. What does IIRC stand for?

Quote: "Your Rift game looks pretty nice. I like the portal effect."


Thanks

Quote: "What are you using Image Kit for?"


It's not in the screenshots, but I'm using it to create a wobbly effect over the portals when only one portal has been placed. It makes a wobbly orange texture over it. It's a bit difficult to explain. It also makes more sense if you've played Portal or Portal 2. Really, though, if you've Portal 2 you should have played Portal. If you have played Portal 2 and not Portal then you're missing out on a HUGE amount of the story and some great puzzles. Plus the graphics are only slightly better in 2 so no need to worry about graphics.

I do go on a bit, don't I?

I will have a demo out today or tomorrow (finally)

Clonkex

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Aug 2011 00:24
Not FF I'm afraid...

I have found that the following code does NOT remove the original image before creating the new one, and I can't see why:




This is done in a loop, so image 1 will exist. When I change the text and write it to image 1, the old text remains there too.

I haven't found any other way to write the text to a render target successfully. It has to be a render target because I am writing to it and then pasting it to another target with an effect.

Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 19th Aug 2011 00:45 Edited at: 19th Aug 2011 00:47
Quote: "if image exist(1) then Delete Image 1"


I haven't done much research on deleting images made with the IK. Is there an IK Delete Image command?

EDIT: Just checked, there doesn't seem to be.
EDIT2: I've had problems with rendering to images, maybe it's not allowing it to be deleted because the camera is rendering to it?

Clonkex

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 19th Aug 2011 10:33
Hi Clonkex,

Image Kit just adds a standard image(normal image) or a set camera to image-image (render target) to DBP's image list. Deleting an image is the same whether or not the image was created using image kit or DBP, or even IanM's MatrixUtils for that matter.

Does DBP crash when deleting the image, or just an error? If it crashes then it might be good to find the command that causes the crash. Try putting if image exist(1) then ... before some image kit commands and see if that is the cause. If it is, I'll have to fix it.

Cheers!
Sven B

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Aug 2011 11:39 Edited at: 19th Aug 2011 11:39
It doesn't crash. The problem is that it doesn't seem to delete the original image. My first image and replacement image are transparent, so the result looks like this:



Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Aug 2011 22:43 Edited at: 19th Aug 2011 22:44
This is the problem above in action.

https://forumfiles.thegamecreators.com/download/2246625

It seems like the images get confused, and pasting to image 3 ends up on image 2. Image 2 should never have the sphere. I'm sure I've removed any silly errors from the code.

Keep pressing a key to trigger the deletion and recreation of render targets 2 and 3.

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Aug 2011 11:52
I have extended the code (you can copy and paste this into the above example). This shows that using IanM's Make Image, you get the same results.

The weird thing here is, that it doesn't delete the text but adding IanM's code stops the sphere being copied from image 1 to image 2 - in the IK code!




Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 22nd Aug 2011 08:44
Quote: "Image Kit just adds a standard image(normal image) or a set camera to image-image (render target) to DBP's image list. Deleting an image is the same whether or not the image was created using image kit or DBP, or even IanM's MatrixUtils for that matter."


Ok. I hadn't needed to delete images at the time, so I wasn't sure how it worked.

Clonkex

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 22nd Aug 2011 12:59
My problem is resolved. IanM has the same behaviour in MAKE IMAGE, you must clear the image (CLS 0).

Login to post a reply

Server time is: 2024-11-23 12:31:39
Your offset time is: 2024-11-23 12:31:39