A Flash Developer Resource Site

Page 3 of 5 FirstFirst 12345 LastLast
Results 41 to 60 of 93

Thread: [AS2/3][Flash8+] 3d engine kit

  1. #41
    FK founder & general loiterer Flashkit's Avatar
    Join Date
    Feb 2000
    Location
    Sydney
    Posts
    1,149
    have I told you lately that I love you?
    ROCKING work render. I cant wait to play with it ... its made my saturday!!!!
    (morning).... you'd be hard pressed to make my saturday night with a code snippet no matter how clever!
    Regards Mark Fennell - Flash Kit Founder, general loiterer
    -------------------------------
    I Hate Zombies - iPhone Game | markfennell.com

  2. #42
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    That's pretty impressive!

    And I'm really sorry, I always thought that the as3 engines had perspective correct texture mapping
    But then again, that makes it all a lot easier!

    I didn't get a lot of work done since my last post, but my engines running now, (took only 2 minutes to sort out a few things between the classes), and it's working together with the materials, so now it should be easier to implement the texture mapping. I'm just finding a way to add-in lighting...a for loop through the lights in the scene and apply each one to each plane?

    BTW, my engine currently already has the camera model built-in. I'm just gonna add in an isometric mode, just to make it run a little bit faster...

    I just checked out all your links at the bottom of each of your posts, and I didn't know you had made so many advancements in Flash 3d! You are gold to any competent 3d engine team, or anyone for that matter!

    I really want to get CS4...do you think that as3 can do pixel crunching? All I'd need to do is go through each pixel on the screen, and do 2-10 numerical comparisons...(hexadecimal). Of course, if just that runs slowly, I'll have to ditch my idea, but otherwise, I think I may have a very powerful engine...

    Man, this thread right here has really made my day/week/month! I finally got to learn more in-depth about some 3d engine details!

    You know what, I hope you're not going to make that little resident evil model into a game! The whole point of me starting to do 3d in Flash (since this Spring!!!) was to make a 3d horror game for halloween! Hell, I've poured a lot of time into this stuff...now that I think of it...

    Anyways, keep up the good work! I'm VERY close to finishing my first 3d engine class package, and will post a thread on it very soon, so people can comment/criticize my engine structure.

    P.

    Hell, you don't know how glad I am to have stumbled upon this thread!
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  3. #43
    Custom User Title Incrue's Avatar
    Join Date
    Feb 2004
    Posts
    973
    I really want to get CS4...do you think that as3 can do pixel crunching? All I'd need to do is go through each pixel on the screen, and do 2-10 numerical comparisons...(hexadecimal).
    If thats to make the lights you better check pixel bender and hydra, thats adobe's way to make shaders

  4. #44
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    It's not exactly to make lights...but...can you do that with pixel bender? I really hope so! I always tried to find info on pixel bender, but couldn't find anything good... Thanks Incrue!

    Ok...so I'm just going to clean up a bit, stick in a million comments, and post it, though I'm a bit reluctant since I made my materials a bit weird...as in I have no idea how the rendering pipeline usually works. I'm researching that now a bit, gonna take a look at away3d or something...

    P.

    By the way, Render? Your UV matrix screws up if you have a square image, and you try apply the uvs:
    x1 = 1, y1 = 0
    x2 = 1, y2 = 1
    x3 = 0, y3 = 1
    That's just the pseudo-code, but I hope you get it? Strangely, the thing worked perfectly again if I just shifted them all down 1:
    x3 = 0, y3 = 1
    x1 = 1, y1 = 0
    x2 = 1, y2 = 1
    Anyways, that's just to tell you, but I'll work on it a bit too...

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  5. #45
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    @Pazil: skipped some of my replies?,- read again:
    http://board.flashkit.com/board/show...2&postcount=35

    @Flashkit: you're always welcome

  6. #46
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    No, no render, I know that you know there's problems with it, I was just telling you how I got the problem...just so you know...in case you didn't...but I'm guessing you already did.

    I don't want to post my engine...since...I'm too unsure of it. It's just that I have no idea how the other one's work, and it feels as if I'm doing something wrong with mine...It's not too flexible...yet atleast. I just added a rotate function that rotates the mesh around it's origin. I don't have any importers , and I'm pretty sure that I have the materials wrong...I mean they work, but it just seems weird to have the material actually doing the lineTo operations and such...

    Anyways, I'll just clean it up and see what I do...I was hoping you could give me some advice?

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  7. #47
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    sorry for beeing blunt here but...

    you are dragging this a bit into your own direction without actually showing anything- neither do you plan to share- so to be honest I could care less so far.
    If you have something to share,- other ideas, variations ect. then please post it here- if its about talking about your secret engine leave it till you have something to show.

  8. #48
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    Fine. If you're really keen on seeing literally crap that doesn't work. I wasn't aware that you're apparently psychic, and can tell when people will share things and when they won't. Maybe you should reread things twice, and also ask questions before suddenly assuming things. I didn't know secret meant trying to do something good before showing it.

    Sorry for not a lot of comments / out dated ones, but I'm submitting this so people can see that I actually am doing something that I can share with everyone, and that this is not some secret engine that I plan to keep my own. I just thought that most sensible people produce something more worth seeing and using, fix all problems, and optimize before actually sharing/publicizing...I guess I was wrong, and that some people prefer to see something unfinished, and then criticize that it's not done or that it doesn't work.

    Yes, you have been a lot of help render, and no doubt you will be, but if you intend to rush people that don't have a lot of time in the first place, and that the matter of working at ones own pace doesn't seem to suit you, then good luck with working with other people, and me.
    Last edited by Pazil; 03-01-2009 at 04:37 PM.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  9. #49
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Calm down a bit there mate, no one is holding a gun to your head [ To see your engine ].

    Wait 'til it's ready, it's pointless otherwise.

    I think the issue was that this thread was slowly being diverted from the original topic due to your apparent enthusiasm about your own engine.

    Enthusiasm is great, but it can dilute the original message of a thread. Perhaps start your own thread covering what your engine can do at the moment, what you expect the first release to be able to do and ask questions in that.

    People like render who are into the whole 3D engine from scratch thing, like you are, will answer in your thread.
    That way this thread stays on message and there's no chance of wires getting crossed like they obviously have.

    Squize.

  10. #50
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    I see what you mean...

    I will post another thread soon.

    Thanks, render...it is sort of a launch for me, and I hope that is what you wanted to achieve with your post...
    Quote Originally Posted by renderhjs
    ...
    So perhaps with this post I can take away some of the magic wall that exists and motivate others to give it a try as well.
    Keep developing the engine!

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  11. #51
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    Ok...well, renderhjs, if you want a small suggestion, then I have one...

    For your engine, you take the whole texture image, and then render it for each face, which means that flash is transforming a whole bunch of pixels that it doesn't need to. Wouldn't it be a lot faster if you cache the needed bitmapData's before even going on to rendering...Basically just have a for loop run through all the faces once, and then clip the bitmapData object for each, which means yes, it needs more memory for all the bitmapData objects, but I think the speed increase would be noticeable enough for it to pay off.

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  12. #52
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    you mean caching slices out of the bitmap to be transformed? I did that in the past in my first generation of texturized 3d engines, here is a example of that:

    a demo to a similar demo of that time:
    http://www.renderhjs.net/renderhjs/o...issan_demo.swf

    but that mainly was also because the way I transformed triangles. In the end I had bleeding edges and some other nasty side effects simply because I resized some of the slices- or some of the flash functions used back then.

    later on I noticed (or so I still believe) that at least in Actionscript anything is referenced all you control is the flow of the pointers.
    Of course I could use smaler slices for each face but like I said I dont think that it will run really that much faster except I would use like 2k or 1600² textures- then maybe. But even if I take slices and create individual bitmapData slices from them I dont think it will run faster.

    I assume that the beginBitmapFill(,...) and the drawing API in mix with the Matrix class already 'hopefully' clips out what it needs to rasterize in a effecient way. If I am right you assume that it rasterized everything including the pixels that are not even seen in the polygon but I dont think that thats the case- for that you have the Matrix that tells the flash player how to read or transform each pixel needed for that polygon - (not the other way around: transforming all pixels and pick out the ones you need).
    Maybe if you have the time give it a shot in your engine - maybe there will be interesting results.

    Another thing is that recently I have been playing with animated textures in my experiments, a spritesheet like this one
    (rendered from 3dsmax with motionblur)

    the UV coordinates get shifted - for that I wrote a custom sprite sheet manager but still the fact that I can just change the pointer in Actionscript lets me assign animations on the 3d model without performance lost compared to static textures. So swapping textures is very fast and no problem at all.
    PHP Code:
    var skinTexture:BitmapData = ...
    var 
    clothTexture:BitmapData = ...

    var 
    tex:BitmapData clothTexture;//assign pointer
    canvas.beginBitmapFill(tex,mtx,0,false,...); 
    and because of that I used in my getUV function a additional parameter of the bitmapData to read out the width and height so that if I would swap the texture regarding of its dimension it would work in relation.

    another issue is that with taking slices would be that I need to recalculate each UV-set per object. While loading would gain advantages (loading just 1 mega texture instead of multiple files)- its would still require a xtra architecture to manage all the assets, adress them and index them.

    there is a nice article on that btw. on gamasutra
    http://www.gamasutra.com/features/20...vanov_01.shtml

    ... or did I perhaps misunderstood the idea of yours?



    btw. will soon have something new to show that I can (personal project). Been working yesterday on a new binary fileformat for my current project (a digital book) that stores:
    - uv (faces, vertices)
    - polygon data (vertices, faces)
    - key frames
    - unqiue vertex positions of each moved vertex, per frame
    the filesize is really smal as I tired this time to really compress the file. Its a fileformat for objects with vertex animations like this stuff:
    http://www.renderhjs.net/bbs/flashki..._dune/demo_13/
    so that I can use animated 3d objects with a smal filesize for the project.

    For a example I exported a rotating teapod with:
    - 512 polygons (~ 992 triangles)
    - uv data,..
    - 5 keyframes
    and it was about 32.6 KB,- thats smaler than any quake2 or text- based fileformat (e.g collada DAE, OBJ, ASE,..) can be.

  13. #53
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    That's pretty amazing!

    You understood perfectly of what I meant about the slicing of triangles out of images. Just the way I understood the architecture of the beginBitmapFill() function was that it applies the matrix to the whole bitmap, and then when you draw the points on the screen, it makes the equivalent of a mask to the bitmap object...atleast that's the way I always thought it worked, which is why I thought that texture atlases would be even slower to use. I never knew texture changing was that big of an issue!

    I understand now for sure that you use 3ds max, and then just export the models, and then load them in dynamically in Flash.
    I, sadly, don't have 3ds max, BUT, a program which is actually better than 3ds max (so I've experienced and heard), is free, but is extremely hard to use if you don't know the keyboard shortcuts, is Blender (blender.org). So I'm going to give a go at importing X3D Extensible 3D (.x3d) files, which appears to be quite a standard to many programs, including Blender. Your thoughts?
    It seems to handle the basic information quite well, and is certainly enough for any Flash 3d engine...

    Anywho, your game there really has an "Alice in Wonderland" feel to it. I like it!

    Blender includes Python scripting, so I'll start to see if I can use that to export the meshes and such more efficiently in binary or something...I can't wait to see your next release/update!

    Also, how many textured triangles do you think an as2 3d engine could/should handle?


    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  14. #54
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    I use 3dsmax as a tool and as a application. Its very powerfull when you are working with game engines or custom pipelines as almost anything (basicly everything) in 3dsmax is non- linear in workflow unlike maya for example. I assume you have heard before that 3dsmax is used alot in the games industry. Game series like Prince of Persia, Unreal or Splinter Cell for example use alot features of 3dsmax (e.g rigging, animating, exporting, scripts,...) to feed their game engines.

    I quickly made a screenshot of my work environment in case you are interested:

    I just type the maxscript in a maxscript listener window and as soon as I evaluate the script (no compiling needed like Flash) I get the generated interface on the left.
    So if I need to change things in my export format I dig into my script and change the parts,- run the script again, select the object and hit save in my interface.
    On the flash or AS3 side I use flashDevelop just started working on the FileFormat reading class that reads the binary data back to flash. On the bottom right you can see btw. the exported file - so it really exists in the folder of my flash project.


    ...actually better than 3ds max (so I've experienced and heard)
    probably heard from hobbiests
    I have yet to see more professional work done with blender- most of it looks amateurish. Bigger companies usually stick to the tools they have been working the last 10 years with- mainly because they invested alot of time in their own very unique pipeline tools and knowledge (that stuff is gold worth).

    For example Blur studios best known for their impressive CG game trailers
    http://www.blur.com/
    is also famous among 3dsmax users for their in house developed maxscripst
    http://www.neilblevins.com/blurscripts/blurscripts.htm

    or take for example pixar who uses Maya and developed on their own Renderman (also used for example by ILM for spiderman, pirates of the caribbean)
    https://renderman.pixar.com/

    those successfully companies wont ditch max or maya just because blender is reaching a acceptable quality to work with- maybe they will incorporate it like they did for creating the animated spiderman storyboard - but in general it will take several years if it ever would happen.

    Btw. a good resource regarding this matter is tech-artists.org where you have alot of guys from big game and render companies like rockstar, bioware,... sharing knowledge in that area:
    http://tech-artists.org/wiki/Main_Page
    it also has good tutorials and resources for Python scripting (the script language that Blender and Maya support, max also somehow)

    sure blender is not bad but its still lacking alot of the flexibility max does (if we compare just those 2 for example). 3dsmax is already veeery long out there- its even older as maya (18 years now if I am not mistaken). And in many ways it always prooved to be solid for the future and I think partly its because of the architecture and design of how things work in the interface ec.t. Of course there are also flaws in max and also in maya and the other big ones. But what stands out that knowledge about the others is more spread and thus:
    - learning resources
    - workarounds
    - plugins
    - compatiliblity
    - expierenced artists with that tool
    are more given - and often those things matter more than just beeing free or open source.


    But I do not want to talk Blender bad,- as I use it from time to time for specific jobs myself (texture baking, AO, exporting,...). I also like the impressive development speed it gains each time. New technologies can be easier tested for developers in blender since all sources of the code are available and problay good enough documented.
    Back on track:
    check this scripts out,- I am highly sure those are Pyton scripts (simple textfiles and simple syntax):
    http://www.rozengain.com/blog/2008/0...n3d-and-sandy/
    http://drawlogic.com/2008/09/26/blen...ndy3d-updated/
    with those you should be able to build your own scripts that export your object in a file.
    Last edited by renderhjs; 11-17-2008 at 10:26 PM.

  15. #55
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    Also, how many textured triangles do you think an as2 3d engine could/should handle?
    63.072
    have a look why yourself:
    http://boards.polycount.net/showthre...t=flash+engine

    not sure how that was reached,- but according to other engine developers (not sure if it was sandy, pp or others) something around 2000 and 3000. But that really depends on how smart you prepare things in your engine, how fast your CPU is and how well your architecture is designed. Personally I think it really depends on what you are after.
    If you are after a resident evil style game with static backgrounds perhaps 300-600 would do.
    A arcade racter pahaps 1500 - 2000 - but again it would really depend on the design direction and engine itself.

    Personally I rather care about pipeline (exporting from 3dsmax, using xml as layout, custom world editor,...) and acceptable speed (sets my work apart from others). If you have a solid project artists can do sometimes magic when it comes to performance. For example by reducing triangles while still keeping the surface detail, or using alpha maps to fake complex shapes ect.

    a few examples from polycounts lowPoly thread:
    http://boards.polycount.net/showthread.php?t=41232

    117 tris 64² tex


    130 tris 64² tex


    400 tris


    478 tris 128*64 tex


    as you can see objects and characters can be very low poly - so you dont need always above 1000 triangles in your viewport.

  16. #56
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    Those examples are pretty cool!
    But...63,072?! In actionscript 2? Wow...my computer must be REALLY slow then...I thought that was what as 3 engines could handle!

    And man...3ds maxes interfaces looks 100x user friendlier than Blender! Is their a programming language that you can use with it? (For example, Blender has Python), or is that max script thing the closest?

    I'm getting really frustrated...it seems as though I'm having less and less time to actually sit down and do some thinking!


    How's your engine doing? It looks like it's really getting somewhere!

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  17. #57
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    AS2 is dated,- that guy optimized for Flash Player 10 with AS3. You should seriosly reconsider updating to the propper language for that project- AS2 is so much slower- but I guess 100 other people told you already that here.

    maxscript is a own scripting language- its really meant as a scripting language not a programming language. That means usually you can script all the dirty way as long as it works.
    You have a kind of macro recorder (similar to the photoshop history) where you can easily learn and copy paste code lines of what you just did in the interface in most cases.

    You can use Python as well but unlike Maya or Blender it requires to download the Python environment and setup it. So I havent used Python yet with 3dsmax.
    I am hooked however about the next blender release as it gets a complete interface update and finally a fully customizeable keyboar layout. That was something many people including me always hated about blender.

    I will post as soon as I have my custom fileformat displayed in the engine- not earlier

  18. #58
    Senior Member Pazil's Avatar
    Join Date
    Sep 2006
    Location
    Ontario, Canada
    Posts
    913
    The new Blender version sounds really good then! Blender also can now create games simply from python, and not having to use crystal light!

    Yes...I've heard people telling me to go to as3, and I really would, if I could. I only have Flash 8 right now, but I'm really hoping to get cs4 really soon. AS3's math is a lot faster right? Would it be realistic to do individual pixel munching if you need to loop several pixels at least twice? Or could you use the shader? I've tried to read about cs4's shader, but didn't find anything too useful...also, do you know if you can draw directly into a bitmapData, or any object that holds graphical info as bitmaps? I'm just wondering, but it would be really good to know...if you do?

    One thing I don't get at all, is about having over 60,000 shapes in the engine...it makes me wonder why all the 3d games out there run so slow (then again, I have a pretty slow computer.)...

    I'll get back to you, I gotta run right now though...

    P.
    WIP-ZOMBIES

    I love vegetarians! More meat for the rest of us!

  19. #59
    FK founder & general loiterer Flashkit's Avatar
    Join Date
    Feb 2000
    Location
    Sydney
    Posts
    1,149
    Ive started dropping it into my engine, just the perspective stuff on the trees adds wonderful depth.

    Im looking forward to trying it with barriers and fences next.....

    which leads me to my next request / question.....

    whats the fastest and easiest way to cast some simple shadows from these objects..... (Im the first to admit that the maths starts to get a little beyond me when raycasting gets involved)....
    Regards Mark Fennell - Flash Kit Founder, general loiterer
    -------------------------------
    I Hate Zombies - iPhone Game | markfennell.com

  20. #60
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    @Flashkit:
    what about this?


    though back then I tricked or had to trick due the depth sorting mechanics involved in tile- systems

    so it only used the contours of the clipping parts

    there is also this ffilmation isometric engine that has a nice lighting concept:

    http://www.ffilmation.org/website/demos/example-1/
    if you see the demo you can see that it basicly copies the sprite- tints it black (or like my demo fills it with a gradient) and uses a transformation matrix to skew it in the oppiste direction of the light.

    but if you have a topDown perspective like GTA things might be a little bit different (if you want to fake it this way).
    Personally I basicly 2 ideas dooing so:

    Idea A.)



    Idea B.)



    anyway in booth cases it might be usefull to render each object in its own sprite container so that you can easier grab just that particular object shadow map.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center