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 / Advanced Lighting and Trees?

Author
Message
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 12th Nov 2013 01:48 Edited at: 12th Nov 2013 01:51
Ok, another Advanced Lighting thread made by me... I'm sorry!
So basically I'm trying my first serious project using Advanced Lighting... I was trying to set up a forest scene, but I'm having problems with the trees...
AL comes with two shaders for trees and other vegetation - tree.fx and leaf.fx. You apply tree.fx to the trunk, and leaf.fx to the leaves. AL also comes with the textures and model for a palm tree (used in one of the demos), made in Evolved's Tree-It.
The problem I'm having is... That's the only damn tree that seems to work! When I load in any other tree model (I've tried about 7 so far, .dbo, .x, pretextured, untextured...), tree.fx textures the trunk fine, but whenever I apply leaf.fx to the tree leaves and texture it with the right images (an ordinary texture and a normal map), the leaves just turn black. I've checked to make sure I'm using the right textures, they're transparent, etc... The shaders just don't seem to work with any other trees. Another issue is that when using any other tree besides the palm tree, the trees don't respond to light properly... This screenshot probably shows what I mean best:
http://oi39.tinypic.com/w1zi1c.jpg
You can see the black leaves in that screenshot too.
Basically, what I'm wondering is... Can Advanced Lighting only work with trees made in Tree-It? :/
If anyone has trees working in Advanced Lighting ok, it'd be great if you could tell me how you managed it
Thanks!
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 12th Nov 2013 02:04
Doesn't he use a third texture stage for the leaves that approximates light scattering or something like that?
If something turns black when a shader is applied there is often a missing texture (if the shader doesn't compile the objects used to be rendered as pure black if I recall correctly, but nowadays they just aren't rendered at all instead).


"Why do programmers get Halloween and Christmas mixed up?"
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 12th Nov 2013 02:41 Edited at: 12th Nov 2013 02:56
I think he does, but I played around with it for a few hours, and removing the detail and light scattering texture stages (3 and 4) from the working palm tree example doesn't visually change the tree much - it still displays fine just using stages 0 and 1 (the standard texture and normal map). Other things I've tried include:
. Texturing my tree with the textures from the palm tree - Same as before; I can see the shape of the leaves, but they're totally black
. Texturing the palm tree with the textures from my tree - the palm tree shows correctly
. Using the palm tree's light scattering and detail texture for my tree - still shows black
. Using .dds format for my tree's textures, the same format as used on the palm tree - still shows black!

I think you're right that black objects usually mean the shader isn't getting a texture, but it feels like I've tried everything with the textures here - I think it's an actual difference between the two tree objects. Both Evolved's palm tree and my tree are in .dbo format, but there is one difference I've found while trying to get this working: The usual FVF value for objects in DBPro is 274, but the leaves on Evolved's palm tree have an FVF value of 338... I honestly have no idea what the different FVF values mean, so it doesn't mean much to me! The only thing I could think to try was the 'convert limb fvf' command (from Matrix1Utils) on my tree's leaves, before applying the textures and shader. Didn't change anything
Do you know anything about what the FVF format means?
Thanks for the quick response, by the way!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 12th Nov 2013 02:58
Fvf stands for flexible vertex format. It sets what data is held for each vertex. Normally you only getbone texture stage and diffuse lighting, (I think) so it's possible that your object doesnt contain the uv co-ords for texture stages 2 and 3. Try setting object fvf obj, 338, where obj is your tree object. Failing that, try creating uv's for stages 2 and 3 on your object.

SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 12th Nov 2013 03:05
I gave the converting the object and limb FVF a try, it didn't seem to change anything :/
Sorry to ask, but I'm slightly confused here... What do you mean by creating uv's for stages 2 and 3? I know uv relates to texturing and texture coords, but how would I create one? Also, stages 2 and 3 don't seem to be necessary for the tree to display correctly, in the palm tree example at least.
GreenDixy
17
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 12th Nov 2013 07:16
I have a question somewhat in this field.
When I export my tree's from the one that comes with DarkGAME Studio and load them into dbpro the textures auto show up how do I add more textures to the trunk etc so I can use shaders on it sorry if my wording is a little messed

.:: Http://DeanWorks.Ca ::.
My software never has bugs. It just develops random features.
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 12th Nov 2013 11:34
Quote: "it's possible that your object doesnt contain the uv co-ords for texture stages 2 and 3"

If that's the case, converting the FVF mode to include such UV coordinates will just deafult-initialize all those uv's to 0. Thus it will only sample the top left pixel for all of the leaves. You can check if that is the case by applying a pure white / green / what-have-you texture to the leaf stage.

Care to share your shader, tree model and the dbp code to make it look this way? Maybe that would help in figuring it out.


"Why do programmers get Halloween and Christmas mixed up?"
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 12th Nov 2013 22:08 Edited at: 12th Nov 2013 22:08
Sure! I've modified Evolved's Palm Tree demo, so it shows my tree next to the working palm tree.
Here's the part of the source code (full source in the download) for loading the trees:



And here's the download:
http://www.mediafire.com/?uljvkhuiqajuv5d
Thanks for your time on this
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Nov 2013 22:47 Edited at: 12th Nov 2013 22:54
This might be a silly question, but where are the textures for your tree? I expected them to be in the same folder as the palm tree textures.

[Edit Oops! Sorry! Found them! Checking them now. ]

Just to check that we're seeing the same thing, this is what I see:





Powered by Free Banners
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 12th Nov 2013 22:53
Sorry GG, putting the textures for the trees together would probably have been the smartest thing to do! The textures (and tree model) are in the 'mytree' folder. It's displaying on yours the same as on mine!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Nov 2013 01:03
No problem. You obviously missed my edit.

I've had a quick look at the files but am none the wiser at the moment. For example, you still get black leaves even if you use the palm tree leaves so it doesn't seem to be the image format. Probably something in the model format. Do you have suitable text based X files of each tree? I can then take a look inside to see what's going on.

I'll look at this tomorrow sometime.



Powered by Free Banners
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 13th Nov 2013 11:46
Hm, my antivirus is telling me the archive contains malicious code and insists on deleting it as soon as it is downloaded.
If you have your .exe file in there, would you mind removing it and uploading a version with just the code and media?


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Nov 2013 15:52
Quote: "my antivirus is telling me the archive contains malicious code"


It's a well-known fact that DBPro is full of bugs so no surprise there.

Can't you simply tell your AV to temporarily unblock downloads? Anyway, yes, there's no need for an exe in there.



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Nov 2013 01:03 Edited at: 14th Nov 2013 01:23
Well, I've done several experiments but whatever I try I still get black leaves on your tree when I use that shader. I'm baffled.

My guess is the same as yours: there's something about your tree object that is different but I have no idea what at the moment.

I can't help feeling we've missed something simple somewhere. I'll have yet another look tomorrow - but a source object in text based X file format would be extremely helpful.

Edit Just had a thought. The shader assumes your object uses vertex diffuse colour - and it needs it in more than one technique. I wrongly assumed that only one of the pixel shaders in that shader required it. Anyway, I've added some code to your program to add vertex diffuse just in case at a fixed value of full white and you now have colour.

Here's the bit of code I added:



and here's the result (it's probably not quite right because of some other leftover changes of mine) - but it ain't black. You'll just need to make sure you use appropriate values for the vertex colours.

That's enough for today - it's past the witching hour here.





Powered by Free Banners
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 14th Nov 2013 01:48
That looks like a Treemagic model to me, I've had problems with them in the past. If this is the same error that I encountered, then it is because the leaf object/limb has no vertex normals (objects exported from plantlife have the same problem).

Solution 1) Try the application from the first post in: http://forum.thegamecreators.com/?m=forum_view&t=70024&b=1 , I've had some success with this tool, but it I'snt able to fix all models for some reason...

Solution 2) if you have Ultimate Unwrap3D, you can import the object then re-export it with vertex normals. Once this is done you can use any modeling program to re-calculate normals (perhaps possible from within UU3D but i've never bothered to check). Because the portion of the model in question is transparent foliage, you will want to unweld the model before calculating its normals (then weld before exporting) to avoid getting strange results.

Solution 3) (Havn't tested it, but it should work) Use the convert object fvf command to add vertex normals, then use set object normals. Unless the model isn't welded, I'm thinking this won't give great results, but it should improve the appearance somewhat. If this method shows any improvement, it can at least verify that the lack of vertex normals is to blame.
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 14th Nov 2013 02:20
Thanks for all the help guys, you're brilliant!
Well... I emailed Evolved about this a day or two ago, because I thought it might be a bug with Advanced Lighting (both the lighting problems and the black leaves)
Just picked up his response:
Hi Sam,

Your normals for the trees look wrong try using dbps "set object normals" command to see it that fixes the lighting issue. As for the black leafs, tree it exports vertex colors so if your tree model dose not use this leafs will just turn out black. open the leaf.fx and find this "float3 Diffuse=saturate(tex2D(BaseSampler,IN.Tex)*IN.color);" and replace it with "float3 Diffuse=tex2D(BaseSampler,IN.Tex);", should then work.


I think that's the same as what you were saying, GG! Both your method and this one seem to work! I'm sorry, I feel guilty for wasting your time on this one... I wasn't sure Evolved was contactable at the moment though, so I thought I might not get a reply. Thank you for the help, I really appreciate it

@renevant chaos It might well be Treemagik... I confess, I nicked the file from a Blitzterrain demo
Set object normals does improve the lighting issue, thanks! I'd try your over suggestions too, but I'm probably going to ditch that tree model when I find one that looks a bit nicer!

@GreenDixy Sorry for taking ages to reply to what you said
When an object already has textures, can't you just overwrite them using texture object?
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Nov 2013 11:35
Quote: " I'm sorry, I feel guilty for wasting your time on this one"


You weren't wasting my time. If I didn't want to spend my time helping people sort out issues then I wouldn't be here. And I enjoy the challenge.

Quote: "Thank you for the help, I really appreciate it"


You're welcome.

Quote: "but I'm probably going to ditch that tree model when I find one that looks a bit nicer!"


Yes, I'm increasingly using TreeIt to make trees instead of Treemagik. I think there's a strange bug in Treemagik which sometimes sets the branches facing the wrong way or they don't fit the parent branch properly (I'm not sure which) - but you can make trees quickly and easily and they are fine if you don't get too close to them.



Powered by Free Banners
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 23rd Nov 2013 01:11 Edited at: 23rd Nov 2013 01:12
Hey, sorry to bring this thread back, just thought it'd make more sense to post here than starting another thread
The project is progressed now that the leaf problem is sorted! I've run into another problem though, which is more image-related than 3d object/shader related this time. Basically, a lot of Evolved's textures have a background colour or texture to them, but that background is transparent. I've got the hang of adding alpha channels to images now, but I'm not sure how you'd go about setting the colours as transparent, but not actually removing them from the image. To show you what I mean, here's Evolved's Palm leaf.dds texture, at first glance:



When you load the image into GIMP or DBPro though, you can see it actually comes out as this:



I can see why the textures are designed like this, because applying a transparent texture to anything in Advanced Lighting seems to cause some of the transparent texture to be seen when the camera's further away. For example, if you have a leaf texture with a white transparent background, the leaf looks pretty much fine close up, but when you move away it gets a nasty looking white pixellation around the edges! But if the transparent colour is roughly the same as the rest of the texture, it isn't visible. Basically, I'm wondering if anyone knows how to get an image like Evolved did with his palm tree texture, transparency included?
Thanks!

EDIT: Sorry if this seems confusing, I'm pretty tired xD
If I've left out any major details, please let me know
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2013 01:35
Quote: "Basically, I'm wondering if anyone knows how to get an image like Evolved did with his palm tree texture, transparency included?"


I would try to do it using IanM's rgb() commands which give you access to the alpha channel. I just set the alpha channel of those pixels to zero and copy the rgb() of the nearest leaf - or do it in strips. The exact colour probably isn't too important as long as it's close to the colours of the leaves. I believe it's done that way so the mipmaps have enough colour in them to stop the leaves disappearing too quickly as the camera moves away from them. The DBPro bitmap commands can be used for this and are quick enough if you're just working on one image at a time.



Powered by Free Banners
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Nov 2013 01:42
Photoshop does that easily and I'm sure most other imaging programs can handle alpha channels too.
The reason for doing that is indeed that the transparent edges should fade out a bit.

Now what I myself wonder is how do you get DBPro objects such as leaves on trees to render with proper Z-ordering (I suppose that is the issue); everytime I try I end up with the closest leaves looking OK, but then if there is a leaf quad behind that one, its "transparent pixels" are never properly replaced with what lies behind it (ie. even more leaves) but it rather just blends the first leaves with the backdrop.


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2013 11:26 Edited at: 23rd Nov 2013 11:55
I had exactly the same problem for a while but then fixed it. I'll try to remember to find out what I did and report back.

Edit Found the demo where it seems to be fixed. The vital thing seems to be transparency mode 4. I attach the zipped project. Use the up/down keys to move around and mouse to turn camera. I was using the demo to see how instancing worked - but did have the problem you described.

Have a look and see if you think this fixes it - I didn't notice any obvious problems while exploring the forest.



Powered by Free Banners
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 23rd Nov 2013 18:40
I usually use transparency modes 3 and 5 for my foliage / tree crowns since the others cause pretty bad artifacts - using mode 4 for example seems to make things draw pretty well up close but everything gets horribly distorted and eventually disappears completely in the distance - perhaps that is why you disabled mip mapping in your demo program? Or maybe it could have something to do with the fact that my leaves are double-sided? I didn't have much time to pick it apart yet (is there any specific magic in the attached shader besides just lighting?) but I'll have a look at it when I find the time. Your example definitively seems to be correctly drawn so it will be exciting


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 23rd Nov 2013 19:59
Quote: "perhaps that is why you disabled mip mapping in your demo program?"


I think so - it's been a while since I looked at it properly. You obviously need mip mapping for most things though.

Quote: "(is there any specific magic in the attached shader besides just lighting"


I don't think so - except I fade the trees out as the camera recedes. That's just to avoid them suddenly blinking out before they get culled. I don't think that is relevant to your issue though.

I'll be interested to hear how you get on - especially as I'm not really sure why mode 4 seems to be needed (but see below).

Just done a quick test comparing modes 3 to 6 in my demo. With 3 and 5 you get awful render order issues because the leaves get blended with whatever was drawn before. Modes 4 and 6 seem to use clipping rather than alpha blending which largely avoids that issue. I notice that Evolved usually uses clipping when rendering trees.



Powered by Free Banners
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 24th Nov 2013 01:01
Thanks for the help guys!

Quote: "I would try to do it using IanM's rgb() commands which give you access to the alpha channel. I just set the alpha channel of those pixels to zero and copy the rgb() of the nearest leaf
The DBPro bitmap commands can be used for this and are quick enough if you're just working on one image at a time. "


Ok, thanks GG. Just one question... How do I save the bitmap? It seems obvious, and it's probably something everyone except me knows, but I'm not sure. The only way I can think of is using get image or save frontbuffer, but I'm guessing neither of those would retain any transparency drawn to the bitmap, since they're basically screenshots?
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Nov 2013 01:22 Edited at: 24th Nov 2013 01:26
Quote: "but I'm guessing neither of those would retain any transparency drawn to the bitmap"

That's probably true.
You could cheat by setting a separate camera to draw to an image, setting its D3D Format value to D3DFMT_A8R8G8B8, then use set bitmap -cameraNumber; this will allow you to draw directly to the image. You can then save the image the camera was set to and it will hopefully contain your image with full alpha (I haven't tried this though so maybe it won't).
Or you could just use memblock images; it should be easy enough to read pixel data from one image loaded into a memblock and one alpha mask read into another and then combine the both. You can then use make image from memblock and save image - this will definitively retain the alpha channel.


@GG: Ah yes, that seems to indeed be the case!
I did a quick test based on what you said and it is by far the best I've got so far. I made a really simple shader that allows you to manually set the alpha clip value; the default value used in transparency mode 4 / 6 by DBPro is 0xcf, but this did cause the edges of some (most) of my textures to erroneously blend with the backdrop colour. I still wonder why the leaves are drawn before the skybox (or in this case, sky cylinder) but oh well... Manually raising this value to 0xdf works to get rid of them for me, although this will obviously differ with various model textures.


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Nov 2013 12:32 Edited at: 24th Nov 2013 13:19
Quote: "That's probably true."


No it isn't. Try this:



Edit

Quote: "[quote]That's probably true."


No it isn't.[/quote]

Hmm? Done a quick test. The colorkey method seems to work fine but the alpha channel method doesn't. I'm puzzled because a couple of days ago I was working with alpha and get image without problems. I'll post back when I've clarified my thoughts on this.



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 24th Nov 2013 18:11
Jut done some more checking and it seems that get image preserves the alpha channel as expected - but only if you use a bitmap other than 0. My earlier program which worked used bitmap 3.

However, in the process of preparing this simple demo I seem to have stumbled across another DBPro bug. Don't you just love it when that happens?

So here is some code showing how to set the alpha channel and grab it using get image (it also contains the bug ):



I don't know whether the bitmap id issue is a bug or a feature . Either way it's unhelpful.



Powered by Free Banners
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 24th Nov 2013 23:46 Edited at: 24th Nov 2013 23:57
Thanks GG, this works great! I'm guessing you need to use something other than bitmap 0 because set bitmap format only affects bitmaps you create after using the command... The bug in ink is weird, though.
Rudolpho, your method sounds great and is probably awesome too, but I kind of panicked as soon as I saw the word 'memblock' xD
I really need to learn how they work someday...

Edit: I'm wondering if I'll have to use memblocks after all
I thought I could cheat by pasting the image to the screen, then using point and dot command to edit it, but most of the images I was going to use are larger than the screen size anyway...
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Nov 2013 00:51
Quote: "I thought I could cheat by pasting the image to the screen, then using point and dot command to edit it, but most of the images I was going to use are larger than the screen size anyway..."


Why not use a bitmap other than the screen? You can use those commands on the current bitmap whichever it happens to be. Use set current bitmap.



Powered by Free Banners
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th Nov 2013 01:23
Point and dot are (or at least used to be) extremely slow though. Just a word of caution


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 25th Nov 2013 14:46
Very true. But I like their intuitive simplicity.

If you really need run-time speed then shaders are your answer for image processing. But only if you have plenty of programmer time to spare.



Powered by Free Banners
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 26th Nov 2013 01:18 Edited at: 26th Nov 2013 03:49
Quote: "Why not use a bitmap other than the screen?"


Ahhhhh
Thanks!
Also, thanks for the warning about the point and dot commands, but it shouldn't be a big problem since I'm generating the textures separately.
Quote: "If you really need run-time speed then shaders are your answer for image processing. But only if you have plenty of programmer time to spare. "


Yep, I'd need plenty of time to spare, seeing as I've never touched HLSL before xD
I downloaded Nvidia FX Composer a few months back, dipped in, then quickly dipped back out again.
If TGC don't end up making DarkBasic Elite, my programming days are probably over when Directx 9 goes obsolete for good... I'm incredibly lazy about learning new languages

Edit: You're right, the point commands crawls -.-
I thought the speed wouldn't bother me, but I literally have to wait 10 minutes for it to read all the pixels from a 1132x896 size image
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Nov 2013 13:21
Quote: "I'm incredibly lazy about learning new languages"


I've been saying that ever since 1967 when I first learnt FORTRAN .

Quote: "I thought the speed wouldn't bother me, but I literally have to wait 10 minutes for it to read all the pixels from a 1132x896 size image"


A shader can do that 100s of times a second which is why I have a long-standing idea to create a simple image editor based on shaders - but the programming is more complicated and nit-picky.



Powered by Free Banners
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Nov 2013 16:09 Edited at: 26th Nov 2013 16:10
Quote: "I thought the speed wouldn't bother me, but I literally have to wait 10 minutes for it to read all the pixels from a 1132x896 size image"

If that is indeed the case you really should try memblocks; they can handle that kind of image processing at near realtime speed.

Here are some functions to help you get started:


Also look into the make memblock from image and make image from memblock functions in the documentation to convert images to memblocks and back


"Why do programmers get Halloween and Christmas mixed up?"
SamKM
17
Years of Service
User Offline
Joined: 25th May 2009
Location:
Posted: 28th Nov 2013 02:59
You're right Rudolpho, memblocks are definitely the way to go. I could probably dodge around them this time, but I need to learn them sooner or later... Thanks for the code, I'll check that out!

Login to post a reply

Server time is: 2026-07-06 10:35:23
Your offset time is: 2026-07-06 10:35:23