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.

DarkBASIC Professional Discussion / Image Kit: Paste Image On Image Problem?

Author
Message
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 4th Jul 2012 04:00 Edited at: 4th Jul 2012 20:25
Ok, i'm completely stumped at why i'm getting random lines on my image. I attached an example which is similar to the project in the video below.



New Video: Still have black parts and white lines


I got it at the exact rate that it is running on my example and I have no lines. Attached is the example. It runs fine but in my other project it doesn't for some reason.

The only other thing I'm using is this code found here: http://forum.thegamecreators.com/?m=forum_view&t=198341&b=30

The rest of the code is just UV calculations.

Any ideas guys?

Thanks,

DigitalFury

Zombie Video Game!

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 4th Jul 2012 04:58
hey there again >.<

my first instinct is Z-Depth try placing an image on the backdrop or turning it off all-together...

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 4th Jul 2012 05:09
@MrValentine - Tried turning off the backdrop didn't change anything. I also removed:
to see if that was it and nothing.

The only other thing I'm using is this code found here: http://forum.thegamecreators.com/?m=forum_view&t=198341&b=30

The rest of the code is just UV calculations.

DigitalFury

Zombie Video Game!
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 4th Jul 2012 06:17
I see... it did look awkward...

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2012 11:30
How many times is the IK paste image on image command called before you get that error? Perhaps that could reveal something.

Could you also post the code for it, otherwise I'll just keep guessing.

TheComet

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 4th Jul 2012 15:16
The rate is 500 per loop cycle. It is very fast. If you run this code though you have no lines and it is at 500 per loop. I've tried speeding that up and still nothing. That is why things are confusing. I'm sure I matched the speed of my main project.



Thanks,

DigitalFury

Zombie Video Game!
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Jul 2012 15:22 Edited at: 4th Jul 2012 15:26
What plugin uses the Copy Image command? I don't have it, and I suspect that is the error as well. The image seems to be copied a couple of pixels bigger than it should be, and the blue lines are the blue border around the image.

TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th Jul 2012 15:38
Quote: "What plugin uses the Copy Image command? I don't have it, and I suspect that is the error as well."


*Thread Title*

Quote: "Image Kit: Paste Image On Image Problem?"


TheComet

Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 4th Jul 2012 15:54 Edited at: 4th Jul 2012 15:58
Oh, well if this fault is developed by a plugin in C source, it needs someone to fix the C source. I have an idea though. If there is a Camera at 0,0,0 it may be spinning off target, because 0,0,0 causes spin. Maybe if the object are all moved the problem might go away. The blue lines are an exact match of the camera angle. When the plain is rotated the blue lines rotate too.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 4th Jul 2012 20:23 Edited at: 4th Jul 2012 20:34
New Video: Still have black parts and white lines


IK Resize Image was part of the problem. Fixed that problem but there still is some black which isn't apart of the image at all. There also is some white lines when ever I rotate around the camera.

Just a side note: I'm using projection to create this. I haven't added this part: Once collided then project image.

Edit: I emailed Sven B to see if he can take a look at this bug.

DigitalFury

Zombie Video Game!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 5th Jul 2012 01:34
Hi,

I came here as a response to DigitalFury's mail.

If I'm not mistaking, "copy image" is a command from the old Image Kit version and "IK Copy Image" is part of the newer version. If you use "copy image", please be aware that you're loading 2 DLL's instead of only one with the same functionality, increasing the .EXE file size. Normally there shouldn't be any functionality in the old version that isn't there in the newer versions so feel free to delete the old version.

The bug looks rather mysterious to me. I'm having a hard time to see what lines are YouTube artifacts and which black lines are actually in the program. Going further on what I can make out from the video, I'd guess that the image has a black border at the top causing the black smears.

The camera should not have an effect on the workings of IK. The basic workings of each of the IK commands (for normal images) are:
- Lock image
- Manipulate (bitwise)
- Unlock image
No camera is necessary in any of these steps. I would say the same for render targets, but since hardware acceleration has proven to give some strange results in some cases (although until now only when using shaders) I cannot give you a 100% exclusion.

Without code this is the most I can deduce from it. I haven't touched DirectX and C++ for a while now so I might be missing something though.

Yours sincerely,
Sven B

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 5th Jul 2012 02:26 Edited at: 5th Jul 2012 04:24
@Sven B - Thanks so much for that post. It isn't the camera like Pincho Paxton said and it doesn't seem to be your plugin. The black couldnt be from black edges but it is completely transparent so it shouldn't have black edges. The lines are not youtube artifacts and are actually created on the actual images.

I removed Copy Image from my main project and still the same results. I also removed IK Resize Image thinking that might be it. I also tried to see if it was the camera but it happens no matter where the object is positioned or the camera is position rotated. It still happens if the backdrop is off.

I deleted the old Image Kit dll.

@Everyone:

Which raises some questions...

Where is the black coming from?
Where are the artifacts coming?

It doesn't seem image kit. I could completely strip my code from having dark dynamics but I'm sure I still would get the same result.

As far as the code i'm trying to keep that a secret :p

What is actually in the code:
- Dark Dynamics particles: Which shouldn't interfere because it is a separate system all together.
- Image Kit for the images. I use Create Image and just Paste Image On Image and that is it!
- A UV lib I made myself which shouldn't interfere in any way because it is just math.

Here is what I use for drawing the particles on the surface:


Paste Image Code:


Other then that i'm no manipulating or doing anything to the images. I just am simply doing the same thing as the example I posted. I'm just pasting images at a rate of 500 per loop cycle.

Here is the example:


It is very strange. The only thing I can think of is something I don't know about is manipulating the image somehow which I doubt.

Anyone have any ideas of what is going on?

DigitalFury

Zombie Video Game!
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Jul 2012 13:20
DigitalFury - What GPU chip are you using?

I ran your example above and I am using an i5 HD2000 chip [had to transfer my 430GT NVidia to another pc to bring it back into life anyhoo no more gaming for me haha...]

but yeah I did not encounter the tearing effect...

chromatic3d
12
Years of Service
User Offline
Joined: 7th Oct 2011
Location: rnd
Posted: 5th Jul 2012 22:14
DigitalFury when I get stuck on stuff like this I try to break things more to see if I can figure it out. Some things to try...
1) change back drop to not black
2) change alpha to something else
3) drop waits around each line one at a time to see if it changes outcome at all.
4) change cam speed (if you have not yet)

Does it only happen when the camera is at an angle?
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 5th Jul 2012 22:19 Edited at: 5th Jul 2012 22:21
@MrValentine - XFX 9800 GTX. I'm confused why I can't duplicate that tearing effect in my demo I posted.

@chromatic3d - The camera seems to have no affect on it. No matter what angle or where it is positioned. Same with the object. The backdrop is blue so I doubt that has to do with the black. I've tried with the alpha being black or white or transparent still same result. It is transparent in the current video so there should be no trace of black. I've tried reducing the particle count as well and still have the same issues.

I'll try a test to see if it is the image by pasting one image on the screen and i'll see if there is any trace of white or black lines. Maybe if I paste it in one spot for a while I might get the same effect. If I dont then it is only when I paste them in different places.

Any other ideas? lol I've tried everything.

Thanks,

DigitalFury

Zombie Video Game!
chromatic3d
12
Years of Service
User Offline
Joined: 7th Oct 2011
Location: rnd
Posted: 5th Jul 2012 22:34 Edited at: 5th Jul 2012 22:38
for the black

Try changing the red value...maybe add other colors. It may be blowing rgb settings past red to black. Try changing the gamma?

for the artifacts

Try changing the resolution up and down. different ratios to see what happens.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Jul 2012 22:35 Edited at: 5th Jul 2012 22:36
Anti-Alias occurred to me. It could be some sort of AA that is causing the black. Maybe if you turn AA to a low setting on your Graphic card it might go away. Or maybe the images have AA in them if you zoom in on them.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Jul 2012 00:22 Edited at: 7th Jul 2012 00:23
@chromatic3d - Changing the gamma did nothing. Anti-Aliasing is turned off so it couldn't be that. I also messed around with all the settings turning stuff off to see if that changes anything and nothing.

Any other idea's guys?

DigitalFury

Zombie Video Game!
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th Jul 2012 00:45 Edited at: 7th Jul 2012 00:46
I just watched it again, and I think that it is AA. I'm sure that I can see some dark edges on the red blobs. Post the images.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Jul 2012 03:20 Edited at: 7th Jul 2012 03:21
Here is what I got for an image:


This tells me it might be Image Kit! If that is the case I can't fix that issue.

Thanks,

DigitalFury

Zombie Video Game!

Attachments

Login to view attachments
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 7th Jul 2012 03:26 Edited at: 7th Jul 2012 03:27
Quote: "Here is what I got for an image:"


Well that has black on it quite clearly. Is that your own image that you load in?

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Jul 2012 03:42
Quote: "Is that your own image that you load in?"


I used IK Create Image.

DigitalFury

Zombie Video Game!
chromatic3d
12
Years of Service
User Offline
Joined: 7th Oct 2011
Location: rnd
Posted: 7th Jul 2012 09:05
DigitalFury is the black caused by some 3d shadow? A place that doesn't get any ambient light? It looks like it starts when you change angles. Does a light move too?

I have not used Image Kit yet so I can't comment on it. The other stuff reminds me of a video card that died on me. It does look a little like the bad flicker I get when putting planes in the same location.

Have you tried changing speed? Frames per second etc It may be more obvious at slower speeds.
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 7th Jul 2012 21:22
@chromatic3d - It can't be shadows because a shader doesn't draw to the images of the object. I'll think I already tried a lower speed and it didn't change anything.

Thanks,

DigitalFury

Zombie Video Game!
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 9th Jul 2012 18:35
Anyone have any ideas what it could be? I think it might be image kit because it isn't the graphics card. It is was is drawn on the image. I am using Paste Image on Image command at a rate of 500 per loop cycle which maybe is what is causing the problems.

I have no way of fixing this if it is image kit so could Sven B take a look at it?

DigitalFury

Zombie Video Game!
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 9th Jul 2012 18:47
Well it also has image tearing, so check out your sync. If your graphic card is taking over the sync that can cause tearing.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 9th Jul 2012 18:57
@Pincho Paxton - I tried turning vertical sync off and it didn't seem to change anything. How can I turn off the graphic cards control over the sync command?

DigitalFury

Zombie Video Game!
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 9th Jul 2012 19:12
Well it's in your advanced screen settings. I only have Windows XP, so I just right click on my Desktop to get the setting up.

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 9th Jul 2012 19:43 Edited at: 9th Jul 2012 19:43
@Pincho Paxton - These are all the settings I have:


DigitalFury

Zombie Video Game!

Attachments

Login to view attachments
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 9th Jul 2012 20:15
Are you using normal images or a render target? Maybe you can try the other type and see if it makes a difference.

Sven B

DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 10th Jul 2012 02:34
@Sven B - I don't understand what you mean.

I am just using IK Create Image and Paste Image To Image commands.

DigitalFury

Zombie Video Game!
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 10th Jul 2012 12:38
Quote: "I am just using IK Create Image and Paste Image To Image commands."


That means you are using normal images. However, there exists another type of images in ImageKit called render targets. The difference is that render targets are managed by the GPU and thus they are several times faster. Check out IK Create Render Target for this. There are restrictions on this type of images (some commands won't work) because these images can't be locked in normal RAM memory, but if I remember correctly then resizing and pasting are no problem. You can find more information in the help files on which commands work with render targets, and which ones don't.

Sven B

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 10th Jul 2012 14:30
What kind of transparency do the images you're working with have? Are they using a colour-key, 1 bit, 4/5 bit or 8 bit alpha channel?

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
Unlocker
11
Years of Service
User Offline
Joined: 26th Jul 2012
Location:
Posted: 27th Jul 2012 00:40
hi guys! anybody knows how fix problem with IK Copy Image

i want copy part of image loaded from file to another image, but in result i have artifact: left 1px border copying to right, right ro left, top to bottom, bottom to top

result in attachment, code here:



what is wrong?

P.S. version IK [v2.041b], graphic card NVidia GeForce 6800

the truth is out there

Attachments

Login to view attachments
Unlocker
11
Years of Service
User Offline
Joined: 26th Jul 2012
Location:
Posted: 2nd Aug 2012 03:51
Sorry it's not a bug of IK copy as i think firstly. It's a bug of DBPro showing object plane with texture.

the truth is out there
DigitalFury
13
Years of Service
User Offline
Joined: 30th Jul 2010
Location: United States
Posted: 2nd Aug 2012 07:54
I already rule out it isn't DBP's common commands. It is an image kit command being overused at a very large rate. I have still yet to test out alternatives but I'll get around to it soon.

As far as the possible bug I posted goes I have still yet not confirmed exactly was is going on.

I'll test this very soon and get back to everyone.

DigitalFury

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 2nd Aug 2012 08:39 Edited at: 2nd Aug 2012 08:41
Just trying to help out here... but if it is a repeating code issue... then perhaps STYX can help?

Quote: "
Intervals, Callbacks, References

If you've ever wanted to be able to call a function on an interval basis (i.e. once every few seconds during your main game loop) then you can now do this with STYX. It allows you to create, start and stop intervals - you get to decide which functions are called, and how often, when you start the interval running. Callbacks allow you to create functions in DarkBASIC Professional that can be called from external DLLs or the Windows API.
"


Just a thought...

EDIT

Got to hate it when you realise you missed out a key point as soon as you click send lol...

My reference was in relation to the INTERVALS feature of STYX...

If you do not have it, I am willing to give it a shot... just throw some code my way to test with...

Login to post a reply

Server time is: 2024-04-20 16:29:05
Your offset time is: 2024-04-20 16:29:05