A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: 3Din again

  1. #1
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230

    3Din again

    I just realized din again rhymes quite well with diniden....

    At any rate, I will use this thread to kinda show the progress of my engine that I'm working on. I will pose questions and all that jazz, and I hope to hear your input on what I've done so far.

    www.diniden.com/3D.html

    Currently this example shows these features:

    -All faces properly inserted into a bsp tree which handles all of the visual problems that may or may not arise and handles backface culling as well.

    -simple lighting. This really isn't a lighting system in my opinion...it's basically the same procedure as a backface cull except we use the dot product to determine the color to choose in the HSL color scheme. Quite cheap but effective-ish. Isn't very pretty IMO

    -Frustrum culling.

    - Re-tessellation of the faces intersecting with the frustrum. I might be making use of bounding boxes soon or quad trees of some nature to help with the frustrum cull. Havn't got that far yet.

    -background work: this engine was incorporated into my very spiffy object handling framework. So, it is easy to spawn copies of a 3D model and associate procedures with each one. Also, this structure has already laid the foundation for separating the differences of static and dynamic objects for helping with a much higher standard of optimization. I also have quite an effective way of assuring transforms not being repeated in a sequence of transforms that may occur on an object or even an individual vertex.

    My next example that i will post will include my ability to use ASE files, and will fix the S and W buttons (looking up and down, the current example doesn't use the proper transform matrix on the frustrum...the next example will...sorry bout that)

    And soon, I should have some weak to decent texturing set up.

  2. #2
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Alright, made it to another landmark!

    Texturing = true;
    Re-tessellation = true;
    proper transform of the viewing frustrum = true;
    lighting = false;

    www.diniden.com/3D2.html

    So there we go. Some major add-ons to the ol' engine, and havn't hit a super bad performance hit yet.

    The problems with the engine currently lie in the BSP tree. It's the most basic BSP tree you can get atm. While it does work, in some cases when you try this random box field, you will notice that intersecting boxes sometimes explodes in a huge number of faces.

    I made it where each object can somewhat control how it affects the balance of the tree by being able to adjust how much you don't want face splits, but that in itself is still not enough. I loaded in a model I made in 3Ds max and the model had around 100 faces, but with the current tree, my engine splits it up into 600-800 faces to properly render it.

    So I probably will be changing out the tree exam algorithm to make it split the faces into convex groupings and then have all of the convex shapes as the leaves of the tree. This could get tricky as well.

    Also, I will be working on adding specular lighting to the engine. Ill play around with dynamic lighting a bit, but I definitely at least want to incorporate pre-calculated lighting for the static models. If anyone has any good sites to check out regarding specular lighting, lemme know!

    Also, I'll be adding a control panel for the future updates, so you'll have a little more something to play with : )

  3. #3
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Ok, added some stupid simple lighting. I havn't done any shadow calculations. But I designed this lighting system for testing how I'll be handling adding lights etc. So far I like the structure of the system and will probably be using this simplified lighting style for any dynamic lighting I may include (almost no point in adding a method for complicated dynamic lighting since it'd make the processor explode).

    Here in this demo you will also see how my engine can use ase files :P. Made this model in 3ds max (I hate that editor btw, gonna grab me some maya eventually since I have college benefits )

    Also, there is now a control panel. Click the box on the top left to utilize the fun-ness.

    www.diniden.com/3D3.html

    Oh another note: You will see how my failure of a bsp tree splits the model up into a superfluous number of faces. Quite depressing. I'll be attempting various BSP tree methods and see how I can get the face splitting down to a dull roar. Next attempt will be a KD tree.

    And last note: I discovered the point of the near culling plane. That sucker helps keep your textures from freaking out. You will notice how as you glide over the model, the texture stretches to infinity and it looks terrible. The near culling plane set some distance ahead of you should definitely help with that. However, I'm doing a cheap re-tessellation method where it calculates the textures transform via the faces "parent" coordinates (this prevents from having to calculate a transform for every re-tessellated face saves immensely on processing especially for all those faces generated through the BSP tree splitting things up, the parent of a re-tessellated face is the face that was split to make the face). So, I will have a bit of a tricky time solving how to fix that freaking out texture when the camera gets close to the "end" of the face.
    Last edited by Diniden; 07-06-2009 at 07:56 PM.

  4. #4
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    If anyone has tips on shadow calculations and how to go about it, please let me know. It will be first attempt at such a thing for me.

  5. #5
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Ok, I had a hard core thought when viewing the triangulation of my engine. About 80% of the extra faces generated by being split by the BSP tree are actually able to be combined into a single triangle. I see this where a full triangle face spans the entirety of another triangle face and are on the same plane.

    But I see this to be extremely challenging to implement as these potential subfaces may or may not be split by a partitioning plane, which would mean it could cause confusion on sorting if I just combine them.

    Any thoughts on this anyone? (I'm starting to not expect replies, but rambling my thoughts helps me remember them :P)

  6. #6
    Senior Member rachil0's Avatar
    Join Date
    Jul 2007
    Location
    Columbus, OH.
    Posts
    465
    Sorry for the late response, but I got your PM about shadow calculation. I'm pooped right now, but I will try to get you a response soon. Just didn't want you to feel ignored!

  7. #7
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    *is in shock*

    A reply finally came out of someone X_X

    thanks :P I'll be waiting for it! I've been trying to think a bit on my own accord on the matter and xame up with a sketchy "may be possible" way of doing it...but still havn't organized the details in mah mind...

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