Jump to content

Josh

Staff
  • Posts

    23,222
  • Joined

  • Last visited

Blog Entries posted by Josh

  1. Josh
    Today I implemented the last two compound primitives. Tubes are the same as in 3D World Studio, with parameters for the number of segments and thickness. Since the Leadwerks3D editor supports smooth groups, another new compound primitive has been added. A torus is a "donut" shape. These can be used to make curved pipes and other things. Here are the two compound primitives, side by side:

     
    Smooth groups and new primitives in Leadwerks3D allow you to create new kinds of geometry which were traditionally not possible with CSG editing:

     
    An interesting case occurs when a torus' cross-sectional radius exceeds the radius of the ring. At this point the shape folds in on itself, eventually degenerating into a sphere. To prevent this from occurring, the creation function automatically adjusts the cross-sectional radius, as shown in the image below:

  2. Josh
    Since brushes in Leadwerks3D are entities, and the Leadwerks3D editor gives you access to the entity hierarchy throughout a scene, we don't use "groups" like 3D World Studio had. Instead, when a compound brush is created, a parent pivot is created, and all brush segments are made a child of that. When you select any part of the hierarchy, the entire compound brush is selected (unless "Ignore Hierarchy" is turned on).
     
    Since brushes can now have a 4x4 matrix, which wasn't the case in the past, my code for editing has to be a little more advanced. I was initially having some trouble getting this working with my first compound primitive, the arch shape:

     
    However, I think it's all good now. You can see the smooth groups working across multiple subobjects, to give the arch interior a smooth curved surface:

     
    You can also see how the scene tree displays every object in the scene, allowing you to select multiple objects at once.
  3. Josh
    The last day of the season was today, so I was at North Star. We had a storm for the last three days, so the snow was pretty good, just sticky in some places. Even though it was a Sunday, crowds were not bad. Towards the end of the day, most people were hanging out at the lodge and the runs were completely empty. All in all, it was a pretty awesome day.

  4. Josh
    Smoothing groups are one of the most frequently requested features for 3D World Studio, so I am happy to show you their implementation in Leadwerks3D, finally. Smoothing groups are usually stored as a bitwise flag. When two faces share a vertex at a certain position, if they have one or more smoothing groups in common, their vertex normal is calculated as if they are sharing a vertex.
     
    I first attempted to write an algorithm based on edges, which worked great for cylinders but failed for geometry that had faces that influence vertex normals they are not connected to by an edge. I wrote another routine, which uses an n*n*n loop (big programming no-no, but sometimes it's necessary) and got good results with cylinders and spheres. Cones are a difficult case, and if you don't believe me, just crack out a cone in your favorite 3D modeling app and inspect the tip. I got around this problem by adding a max smoothing angle member to the brush class, which allows the smoothing algorithm to discard faces that are too 'different' from the one being processed.
     
    Here's the result:

     
    In order to make shapes like arches appear smoothed, the smoothing algorithm has to span multiple objects. This will be accomplished by first grabbing all the brushes in the nearby vicinity to the brush being processed, and then searching for vertices that occupy the same position, on faces that have a smoothing group in common.
     
    In the past, we've seen some pretty advanced modeling done with 3D World Studio, but the lack of smoothing groups always limited it. It will be awesome to see what people come up with, when those limits are removed and they can model exactly what they want.





  5. Josh
    The subject of spheres in 3D World Studio has been one of great levity (see here and here) around the Leadwerks community. I spent today finally implementing a CSG sphere primitive. This is a little different from creating a conventional triangle mesh sphere because each face is a single polygon with either three or four sides. Here's my scratch paper that got me through this process:

     
    I'll spare you the mathematics and get right to the good stuff:

     
    This completes the basic primitives, which include boxes, cylinders, cones, wedges, and now spheres. Tomorrow I will get started on compound primitives (arch and tube) as well as smoothing groups.
     
    Let the hilarities ensue in the comments below.
  6. Josh
    UML diagrams, object-oriented frameworks, and beautiful modular architecture are great things to develop, but sometimes you just need to make an application that real people can use. For me, that means you start with the behavior you want, and work backwards to make the code that does it. In the past I've considered fancy object-oriented mouse tool classes, but the style of editing I want is intuitive, easy, and fast, using the fewest number of mouse clicks possible to achieve a task. I think that's why so many people loved 3D World Studio, and it's a quality I want to retain in the design of the Leadwerks3D editor.

     
    I now have basic CSG editing working. The code that does this is a little more event-oriented spaghetti than the engine core, but sometimes that is appropriate. I can't wait to start working with a CSG editor again, with new features like smooth groups. Drag and drop materials onto objects is already working, and it feels so intuitive and pleasant to use. This is the stuff I programmatically live for.
  7. Josh
    Everyone's gone for the weekend, and I am still here, so it seems like a good time to stop and say hello to the community, who I have not been communicating with much lately.
     
    We spent some time this week doing some market research, and investigating exactly why Leadwerks is different and unique. After that I feel like I have a much better picture of the game industry as a whole, and of our strategy going forward. That's the "big picture" stuff we CEO's do.
     
    Meanwhile, back on the ground, I have code to write and a few outstanding bugs to correct for Leadwerks Engine. I've made progress and have very basic CSG editing working in the editor. I ran some performance tests with my new iPad 3, and the results are looking good. More on Monday about that. We're looking to recruit a few more interns in the Sacramento area.
     
    Anyways, this is less structured than most of my blogs, but I wanted to write something. How was your week?
  8. Josh
    I feel like I've resolved the design challenges I was facing in my last blog. A menu item is always checked, specifying what the current object is that will be created when the user clicks on a viewport. There are two types of objects that can be created, brushes and entities. Brushes are constructive solid geometry objects that can be sketched out to quickly design a building. Entities are created at a point in space, and include lights, sounds, and particle emitters. As I have described it, this is pretty much identical to the 3D World Studio workflow.
     
    Models in the Asset Browser are another thing. This is where the Leadwerks3D editor is very different from 3D World Studio. Models can be dragged into the scene from the Asset Browser, in either the 3D or 2D viewports.
     
    In the 3D viewport, we will have position/rotation/scale control similar to that found in Leadwerks Editor, the editor for Leadwerks Engine 2. We will improve this with a button to toggle between global and local space. Since 3D World Studio has no 3D editing mode, this can be implemented without interfering with our powerful classic CSG workflow.
     

     
    I think the design I have laid out here will be simple enough to figure out without reading a manual, require the fewest number of mouse clicks possible, and most of all feel natural and fun to use, a quality that I think modern modeling applications have largely lost.
  9. Josh
    I have the basis of CSG editing written into the engine. It was a bit challenging to figure out just how to structure the Brush class. We have a lightweight ConvexHull entity, which is used for the camera frustum. This is an invisible volume that changes frequently, and is used to test whether objects intersect the camera's field of view. I didn't want to bloat this class with a lot of renderable surfaces, texture coordinates, vertex normals, etc. I initially thought I would derive the Brush class from the ConvexHull class, and make brushes a more complex renderable "thing" in the world.
     
    I didn't want to create multiple rendering pathways in the octree system, so it made sense to derive the Brush class from the Entity class, so all the entity rendering pathways could be used to tell whether a brush should be drawn. However, both the Entity and ConvexHull classes are derived from the base class in Leadwerks3D, the Object class. This creates the diamond inheritance problem, where there are two Objects a Brush is derived from:

     
    In the end, I derived the Brush class from the Entity class, and just gave it a ConvexHull for a member. This meets the needs of the system and is simple:

    class Brush : public Entity { ConvexHull* convexhull; ... };
     
    So with that out of the way, it's on to editing. There are three types of objects you can create in the Leadwerks3D editor. You can drag a model into the scene from the asset browser. You can create and modify brushes like in 3D World Studio. You can also create special entities like lights, particle emitters, sound emitters, and other items.
     
    I'm ready to start CSG editing, but the thing that strikes me right away is I have no idea how object creation should work. You can drag models into the scene right now, from the Asset Browser. However, CSG brushes work better when they are drawn like architecture drafting:

     
    For "point entities" 3D World Studio lets you position a crosshair, then hit enter to create the current object:

     
    I'm not sure how we should handle brush and model editing in here. Usually when I run into a problem and am not sure how to proceed, I struggle with it a few days, but when I'm done, I am certain the approach I chose was best. Here's another one of those situations. Feel free to discuss and explore ideas with me in the comments below. Here's what the editor looks like at the moment:

     
    --Edit--
     
    Here's something I am playing with. The "Objects" menu contains a lot of brushes and special entities you can create:

     
    This idea actually goes back to the old Quake 3 Arena editor, Radiant (which was otherwise a pretty difficult tool to use!):

     
    You would still be able to drag a model into the scene from the Asset Browser at any time, but the brush and entity creation would be more like 3D World Studio. Of course, we also want the ability to move, rotate, and scale things in the 3D viewport as well! I generally don't like having multiple ways to do a thing, but the editing choices here make good sense. I'll keep playing with ideas and see what I come up with. Feel free to chime in, in the comments below.
  10. Josh
    The Project Manager lets you manage multiple Leadwerks projects. A project includes assets, scripts, code, code projects for Visual Studio, Xcode, and Eclipse, along with your game's executable. The Project Manager lets you view and switch between your different projects.

     
    Projects can be exported into a .zip file for easy sharing and archiving. You can even have Leadwerks3D scan all source code files and only include the asset files that your game actually uses. (I'm still adding the password field to encrypt them):

     
    You can import projects back from a .zip file:

     
    And of course you can create new projects, for any supported language, with multiple platforms supported by each:

     
    Here's my list of things I have either recently gotten done, or postponed for some reason:
    X -Window order(?)
    X -Convex cast app (postponed)
    X -Script execution
    X -Script SaveAs, SaveAll, New, Open, etc.
    X -Directional light destructor bug
    X -Occlusion query / octreenode bug
    X -Delete thumbnails when folder deleted, if in deleted folder
    X -Send files/folders to recycle bin instead of deleting
    X -Project import from zip passwords
    X -Project switching
    X -CRC32 zip password checks
    X -Improve project import events and process
     
    And still to go:
    -Add password export zip field
    -Animation
    -CSG Editing
  11. Josh
    Lua's debug hooks are a little funny, because they don't appear to allow line-by-line calling of your own function. The description here is pretty vague:
    http://pgl.yoyo.org/luai/i/lua_sethook
     
    The line and count hooks look like they might be what I wanted, but the docs have one big caveat:
    This makes me wonder what the point of these hooks even is. The way I have it set up now, "Step" continues to either the next Debug:Stop() call, or to the next point where a Lua function is called. Not C++ functions, Lua functions only, as shown in the code below.

     
    Additionally, I found that each time the hook was actually being called twice. No idea why, but I added a flag to discard every other call. I'm not too happy with the documentation of this or it's design, but the important thing is that the Debug:Stop() function be usable to set a program breakpoint, which it can. I sent a query to the Lua mailing list, and I'll work on it some more if anyone indicates that it's supposed to be able to do line-by-line stepping.
     
    I did some additional work on the shader editor, adding a few ideas I got from the script editor. The tabs for errors and warnings will show a number indicating how many items each tab has. I also made it so the compiler output gets printed even when the shader is successfully compiled, which wasn't the case before. As you can see in the screenshot below, the shader editor can be very useful for catching problems that might occur on other cards. I have an NVidia GEForce 480 in right now, but I can see from the warnings list this shader probably would not work on other hardware! This is becoming very useful as a diagnostic tool.

     
    Well, that was my day today. What did you accomplish today?
  12. Josh
    I haven't actually had the Leadwerks3D editor running on OSX Lion until a few days ago. There were some underlying GUI issues that had to be updated to handle a few new ways that OSX Lion does things. The first run was pretty frightening, with random crashes and all sorts of visual inconsistencies. However, careful testing resulted in these issues being resolved one by one.
     
    The most peculiar was a bug in which the editor would crash when a file request dialog was opened if, and only if, it occurred any time after a popup menu had been displayed. The error displayed read as follows:
    I initially assumed this was some weird Mac thing that got changed between Snow Leopard and Lion. Google didn't provide much help. Finally I came across this page which hinted that other applications may have a problem with this "SCFinderPlugin" thing. Following the instructions here to uninstall the plugin made the problem go away. Then I remembered that SCPlugin was a sort of TortoiseSVN for Mac I tried out, that I never got to work. Apparently, it causes EverNote to crash when viewing PDF files, and there happened to be a PDF in the folder the file requestor opened by default.
     
    So now the problem is eliminated and the Leadwerks3D editor is working pretty well on Mac. The interface is still ugly and unrefined, but important functionality is working the same across Windows and Mac.

     
    And now I am off to fix a few Leadwerks Engine bugs reported here...
  13. Josh
    In my last development blog, I wrote about some design problems I faced, and why I wasn't sure how to proceed. I've resolved these issues by building the debugger and game output display close to where they will be most likely to be used, the Script Editor.

     
    I was pleased to find that my Lua debugger code I wrote about a year ago works perfectly. This allows breakpoints, code stepping, and the display of variable values in your game. It works with any Leadwerks3D executable, so you can even examine and debug the Lua state in your C++ executables. (This does not debug C++ code or other languages, as there are already appropriate tools for that.) I like to combine the callstack and variable display into one tree view, so you can quickly navigate the program.
     
    I decided it made sense to build the game output and debugger into the script editor, because that is where you are most likely to use it. Even if you are debugging Lua in a C++ application, you still want to be able to double-click on the call stack and display a script in the editor. The only situation where this design doesn't really make sense is if you launch a C++ application and just want to look at the program's output. In that situation, it is a little strange to need to open the script editor to do that.
     
    The actual executable to be launched will be controlled in the project settings. The default for a Lua program will be a copy of the interpreter executable that gets added the project folder. You can specify the script in a command line field, like this:
    +script $scriptfile
     
    Where "$scriptfile" gets replaced with the file name of the currently selected script file in the script editor. For a C++ application, the project will simply be set to call the executable the C++ template sets up a project for. If any of that sounded confusing, take a look at how maps are launched in 3D World Studio (or even Valve's Hammer Editor, for that matter). The bottom line is it's set up automatically when a project is created, and you probably will never need to change it, but the capability is there if you need to.
     
    Previously I wrote that it's better to name a thing with a specific name that describes most of what it does, rather than to broaden the description to become fully encompassing but vague. The same holds true for program and workflow design. The debugger and game output display are built into the script editor, where they will be the most useful overall. It's not "correct" in a hyper-analytical way, but it makes sense and is convenient.
  14. Josh
    The design of the Leadwerks website involves organizing a lot of different kinds of data that are continually growing, including forum posts, blog entries, gallery images, videos, and downloadable files.
     
    All this information was organized in categories, and sub-categories, and in some cases, sub-sub-categories. The depth of categorization made it impossible to follow all the information that was flowing through the site, and users frequently posted in the wrong place. We recently underwent a restructuring of this information in an attempt to make all categorization only one level deep and streamline the viewer's experience. In this article, I will share with you some ideas I learned from this process that were not immediately evident to me.
     
    Programming Forums
    Originally, we had one main "Programming" forum for general programming discussion with several sub-forums which were meant to be used only for discussion of issues specific to each language, like compiling or editor problems. It didn't work out that way, and the community was fragmenting along programming language. Each group tended to participate in only the sub-forum of their language of choice, and I found myself answering the same questions repeatedly, for different languages. I don't know if this was related, but there was also a lot of territorialism among the various factions, with many arguments over which language should "win". Arguments occurred over which languages warranted their own forums. I also felt like the forum had grown beyond my ability to absorb, and had stopped reading the programming forums some time ago.
     
    With the arrival of the tagging feature in our community software, I felt it was time to merge all the programming forums into one, using tags as a 'light' way to sub-categorize posts. I chose to leave the Lua "Script" forum separate for two reasons:
    If we do an "indie" script-only version of Leadwerks3D in the future I want separate permissions for that forum.
    To protect beginners from intimidating low-level programming discussions. Which isn't to say anyone using Lua is a beginner, but beginners tend to prefer script.

    Although there was initial protest against this plan, I went ahead and closed the programming sub-forums for new discussion, without losing them just yet. I also made the Lua sub-forum a top-level forum and renamed it to "Script". My job is not about promoting other technology's brand names, and the user doesn't care much about the underlying technology, so I felt this was more appropriate than "Lua".
     
    Other Forum Categories
    We also had forum categories for sound, materials, modeling, and shaders. All of these sub-forums were merged into a single forum called "3D Artwork". Calling game sounds "3D artwork" may not be terribly accurate, but I'll get to that later.
     
    Gallery and Videos
    At the same time, I was working to simplify the entire contents of the Leadwerks website. Previously, we had gallery images and videos divided up by product. The gallery had four sections for Leadwerks Engine, 3D World Studio, our upcoming game development software Leadwerks3D, and a fourth category for miscellaneous pictures and photos. The videos section was also divided into three categories, by product.
     
    I decided to merge all videos into a single category, and replaced the gallery with a custom implementation that simply displays all images in chronological order, with no attempt to categorize them.
     
    Asset Store
    The Leadwerks Asset Store too was broken up into many sub-categories. The code section was subdivided by programming language, and we had similar issues as we experienced with the programming forums. Although Java was not an officially supported language, there was a lot of material available for the language, so a sub-category was created for it. I felt odd having all these "brand names" scattered across the Leadwerks website.
     
    We moved everything into a single "Code" category, using tags to specify what language a file was for.
     
    Portal
    Additionally, I implemented a community portal page which shows all recent forum posts, images, videos, status updates, blog entries, and asset store files. Items are displayed in chronological order, with no sub-categories.
     




    The new face of the Leadwerks community.


     
    The Result
    The reorganization of the programming forums was the most drastic change, and I think the community has generally agreed the change was for the better. I am once again active in the programming forums, and it's easy to keep up with current discussions. I made the final change and merged all posts from the programming sub-forums into the main programming forum, then deleted the sub-forums.
     
    The site overall is much easier to follow, especially the videos and gallery images. A chronological stream of recent items trumps sub-categorization, any day. Because there are fewer sub-sections to check on, it's much easier for me to keep up with the flow of content. Although I don't have any statistics to back this up, I feel like the community is more active now than before the change.
     
    Choosing Titles
    I have learned that slightly inaccurate and specific titles are better than encompassing but vague titles. For example, I removed the "Sound" forum and moved all posts into the "3D Artwork" forum. Is it accurate to include posts talking about video game sound and music in a forum that is mostly devoted to discussion of 3DS Max and Photoshop? Probably not exactly. Would it be better to call the forum "Game Assets"? You might be inclined to go with this suggestion, if you are an analytical type, but consider the following:
     
    iTunes is Apple's online music store. It was originally built as a program to purchase and sync music for iOS devices. Movies were added to the program's features, and the title "iTunes" was no longer exactly accurate. Would it have been better for Apple to rename the application to "iMedia" like "Windows Media Player"? It would be more accurate, but no one would have any idea what it did. When apps were added to iOS, iTunes gained the ability to manage applications as well. Should the program be renamed to "iContent"? It's a more accurate description, but it's so vague it loses meaning.
     




    iStuff?


     
    The name "iTunes" is catchy, and it describes the main point of the program, even if it doesn't encompass all functionality of the program. This is a weird idea to me, because as a programmer, my inclination is always use a broader and broader term until I reach one that encompasses all characteristics of the thing it describes. However, I am certain that a catchy title that describes the main point of the thing it describes is superior. With this idea in mind, it makes perfect sense to include game sounds and music in a forum about 3D game artwork. It is exciting to me to learn something that is illogical but self-evident.
     
    Conclusion
    When you categorize things, choose fewer categories with descriptions that encompass most of what they contain. Never get too analytical about the categorization and naming of things. Instead, just go with what feels more natural and catchy, even if your nomenclature is slightly inaccurate.
     
    We still have one big contradiction of this idea on our site, the use of the term "Asset Store". Leadwerks3D actually uses a class called "Asset" as a base class for textures, materials, shaders, and other objects, but about 40% of total files, and 100% of paid files in the store are 3D models. Additionally, the term "Asset" still isn't broad enough, because code files and games are not an extension of the Asset class. It would not be out of the question to rename the Leadwerks Asset Store to the "Leadwerks Model Store". The analytical (and much worse) extreme would be to call it the "Leadwerks Digital Goods Store".
     
    Keep your names short and catchy, and don't try to broaden them to encompass every aspect of the thing that they describe.
  15. Josh
    Sometimes I run into situations where I don't really know how to structure things. I don't mind this, because it usually results in some really elegant design once I figure out what to do. I just play with ideas and try not to force anything, and when the right idea arises, I will recognize it.
     
    Explaining a problem to someone else can help facilitate that process. How many times have you solved a difficult problem right after you posted a description of it on a forum somewhere? The procedure of explaining it logically to someone else can help you think more clearly about it. And so, we have today's blog topic.
     
    Below is a very rough start to the script editor. The syntax highlighting system was written about a year ago, and works beautifully, using the native text widget on both Windows and Mac.

     
    In the Leadwerks3D source code, there is a base class called an "AssetEditor". From this class the material, model, shader, texture, font, and script editor classes are derived. Like the other asset editor windows, only one instance of the script editor window will be allowed open at any time. Unlike the other asset editor windows, which display only one asset at a time, the script editor will use tabs to display multiple files. Scripts aren't a typical asset like a material or a model, so it's fine for them to behave a little differently.
     
    Any Leadwerks3D application can have its Lua state debugged. The engine uses networking commands to communicate with a debugger on a specified port. This means the engine can communicate with a debugger whether it's part of a C++ program, C# app, or standalone Lua interpreter. The debugger can display the Lua callstack and shows all variables and values in the Lua state, including full examination of C++ objects and members!
     
    I do not intend for Leadwerks3D to "play a game" in the editor. We've tried that approach and there are a lot of problems. I want Leadwerks3D to be a very solid and stable level editor, with a visual interface to do everything you need. I also want better consistency between Lua and C++ programs. Therefore, Leadwerks3D will use a run game system more similar to 3D World Studio than the Leadwerks Engine editor. A dialog will allow you to choose the application to run, command-line parameters, and other settings. These will be saved between sessions, so you can hit a key to do a "Quick Launch" and run your game. It would be possible to hook the Lua debugger into any application as it is launched, which could be very helpful.
     
    Let's go back to the script editor now. My inclination is to have F5 launch an interpreter and call the script for the currently selected tab. However, I don't think it's a good idea to use multiple game launch modes, I already described a uniform game launch mode for both Lua and C++ applications, but that seems sort of counter-intuitive if you are working in the script editor and just want to run something really quickly.
     
    There;s also the question of whether we want to provide a standalone script editor and debugger outside of Leadwerks3D. Or should the debugger be a standalone application as well, since someone might want to use it with a C++ application? You see there are a lot of options and a lot of possible ways to set this up.
     
    What about Lua compile errors? I can print that out in the engine log, but how will the editor display it? If a compile error occurs, should the program pause and display the line it occurred at? What if the user just doesn't care, and wants the program to keep going?
     
    Alternatively, the user may want to just hit F5 in the script editor and check for basic syntax errors, which the command LuaL_LoadString() will detect.
     
    That's pretty much all my questions at this point. I don't expect anyone to come along and solve my problems, but the process of describing and discussing the issues will help me come to a resolution.
  16. Josh
    I've got orthographic viewport navigation done. I decided to build some grid commands into the camera class so that the graphics driver itself can handle the grid rendering, rather than having the editor make a bunch of OpenGL calls in a callback function. The grid can be rendered from any angle, and the math was a little tricky, but I got it worked out. I paid extra attention to showing the border where the world ends. The sliders that pan the viewport are very accurate, and stop right at the end of the world space. By default, this is one kilometer, but the world size can be changed at any time.
     
    One thing that was tricky was that the grid can be any resolution, and the world can be any size, so there's no guarantee the edge of a grid patch will match the edge of the world. I ended up using clipping planes to solve this problem.
     

     


  17. Josh
    I'm happily starting out on the CSG editor. The first step is to add a grid in the orthographic view modes so that you have a frame of reference. In Leadwerks Engine, the editor used some callbacks to call OpenGL commands to draw the grid. In the new system, Leadwerks3D, I added some per-camera commands to control the grid spacing, resolution, and colors. (You may safely ignore the mysterious black cube in the center.) This way the editor never has to call OpenGL commands directly, making room for the possibility of other rendering APIs the engine can support in the future, like DirectX or software rendering.

     
    One small little detail: In the Leadwerks Engine editor, the editor simply calls immediate draw calls (glVertex3f, etc.) to draw as many lines as are needed. In each orthographic viewport in the above screenshot, there are about 80 lines being drawn, which would require 80 draw calls. In Leadwerks3D, the engine creates a repeating patch and renders it as many times as needed, very similarly to how terrain is rendered in Leadwerks Engine. This reduces the number of draw calls in the above screenshot to about 24. Of course, instanced is always faster than non-instanced, and vertex buffers are much faster than immediate mode drawing, so this will increase the responsiveness Leadwerks3D over both the Leadwerks Engine editor and 3D World Studio.
     
    The next step will be to add controls to navigate viewports. This includes free-look with the mouse in perspective mode, and panning and zooming in the orthographic views.
     
    After that, I will start the actual code for drawing primitives, like 3D World Studio does. The functionality of 3D World Studio and Leadwerks Engine are being merged into Leadwerks3D. I miss the convenience of CSG editing. It allows non-artistic people like me to easily put together good looking buildings and interiors. It also makes it easy to establish a theme for a scene using sets of pre-made textures. And if nothing else, it's a convenient way to block out scenes for play testing, until the real art assets are finished.
     
    You'll also notice I have switched my main development machine to Windows 7 for the last leg of this journey. We're on schedule for a summer release this year.
  18. Josh
    I generally categorize every aspect of Leadwerks as either "absolutely required" or not necessary. If it's categorized as the latter, I don't bother with it, and if it's categorized as the first, I pursue it with a dogged determination until it is done. This has served us well in many ways, like our vegetation rendering system and character controller.
     
    However, this assumes I have full control and mastery over the product, or at least have someone working for me who does. This is almost always the case with software development. I do not have the same power over other aspects of Leadwerks like the website. Our bug reporting system, based on IP.Tracker, was an unsupported unofficial add-on offered by Invision Power Services. That means they offer it, but if anything goes wrong you are on your own. This should have steered me away from using it. I generally never use any third-party add-ons, especially free ones, but the features were nice and it was compelling. (The one exception in our system is our chat system, which has functioned wonderfully, but also came with a fairly high price tag. Correlation?)
     
    After installing IP.Board 3.2, I attempted to install the new Tracker that works with it, but the installation process would not work. I even got IPS to look at it, despite their policy of this being a non-supported product, but their "fix" was quickly done and didn't actually fix it. I could keep pestering them, but I've already spent a lot of time on it, and we're never going to get a real solution. Even if it could be installed successfully, a new problem could arise at any time, and we'd be back in the same position as before. The application hasn't been updated since August of last year even though there are outstanding bug reports. Despite all it's complexity, there's really no other forum/CMS that comes close to the features IPB offers.
     
    Anyways, the point of my long-windedness is that I'm giving up on upgrading IP.Tracker and created a bug report sub forum here:
    http://www.leadwerks.../59-bug-reports
     
    The data is all in the database still, and there's a possibility we might be able to migrate it into the forum, but I honestly wouldn't count on it. The value gained per unit effort is getting very bad if I keep going down this road.
     
    Additionally, the new IP.Gallery application is so badly designed I consider it unusable. Even before the upgrade, people frequently posted images in the Showcase forum rather than deal with the complexity of managing albums and uploading images into different categories. I have implemented a custom system here we have complete control over. I encourage you to re-post your images here where they will be safe, and I have complete control over the layout and design:
    http://www.leadwerks...ce/page/gallery
     
    I have posted a few images there to test with. If I posted one of your images and you would like to re-post it in your own name, I will gladly remove my upload. Additionally, the latest images will soon be added to the Portal page, mixed in with the latest videos thumbnails. A link to the old gallery will remain at the bottom of the Gallery page until April 1, 2012 so you can access your images.
     
    This is a complex site, and I am operating it with a minimal amount of IT support. Going forward, we are going to implement a few policies to minimize problems.
     
    1. No third-party applications or features will be utilized, with the exception of our chat bar, which is a paid third-party product that has always functioned perfectly.
     
    2. When a custom database can serve our purposes, that will be preferred over third-party applications and even some official IPS applications. For example, I implemented a custom database for the video section, articles, and replaced IP.Gallery with our own system. (I do not have any plans for any additional databases or website features in the near future.)
     
    The upgrade to the latest version of IP.Board was well worth it, in spite of those couple of problems. First, it would have been very difficult to find a designer capable of and willing to work with the old version. Second, the new system cleans up a lot of the functionality of the older version, which oould be quite chaotic in some places. Finally, it ensures we are up to date if any security issues should arise. There hasn't ever been any, and I have no reason to believe there will be, but it's best to be prepared. IPB 3.1+ was really an infant product compared to the more mature version 3.2. Further versions of the system are not expected to be such drastic changes, as the feature set and design has solidified quite a lot.
     
    Thank you for your patience and especially for generating all the great content that makes this site so fun to browse.
  19. Josh
    You can drag entities around in the model editor to rearrange the hierarchy. Now I just need to add an option to collapse a hierarchy, and the basic art pipeline will be done.

     
    I had a difficult bug that was causing model hierarchies to be duplicated. At first I thought I was saving files wrong, but it turned out my entity copy routine was duplicating the hierarchy twice! Oh well, problem solved.
  20. Josh
    The articles database makes a triumphant return with a beautiful new template:
    http://www.leadwerks...e/page/articles
     
    The front page shows the most recent articles. Clicking on a category on the right gives you the entire list of articles for that category:
    http://www.leadwerks...s/_/programming
     
    The new template I designed will help organize and present articles better. There's some great content written by the community, but I haven't provided a very clear specification for the articles section until now. Here are some things you can do to improve the appearance of your articles:
     
    You can separate your article's contents into pages with the "page" tag:


     
    If your article uses a YouTube video, you can submit up to three YouTube video IDs. These will be displayed in the upper-right hand corner of the first page of your article, as seen in this article:
    http://www.leadwerks...o-animation-r11
     
    You can add a 160x120 JPG image to your article, and it will be displayed in the article lists. Do not add PNG images or your own icons, as they will make the page look inconsistent. Just use screenshots from the contents of your article:
    http://www.leadwerks...er_page=5&st=35
     
    The articles section is not a place for code snippets or downloadable tutorials. These items can be posted in the Leadwerks Asset Store "Code" and "Tutorials" sections:
    http://www.leadwerks...werkspace/files
     
    Do not link to other articles, external images, or anything else in your tutorial. Many links eventually become broken with time. We want to minimize maintenance demands.
     
    I'm also running Google ads on the articles and video pages, mostly just as an experiment. I feel like these are sections that are okay to display an ad in, and hopefully the community won't find it intrusive:
    http://www.leadwerks...ine-preview-r16
     
    If you haven't been to the videos section lately, check it out. It's looking pretty good:
    http://www.leadwerks...ace/page/videos
     
    Thank you in advance for your help keeping the community's content organized.
  21. Josh
    I apologize preemptively for the title.
     
    So I picked up a Samsung Galaxy Tab today, for testing...yeah, that's it, "testing"...

     
    I installed the USB driver for Windows, restarted my computer, and was able to start debugging Leadwerks3D on it with no trouble at all. However, the rendering showed black objects that ought not be black.

     
    At this point in the game, having such a basic issue is very scary to me. I tracked the problem down to the lighting uniforms being passed to the shader, but something didn't make sense.
     
    In GL Shading Languages (GLSL), you can have arrays of uniforms, like this:

    vec3 mediump lightdirection[4];
    A uniform array like this should be accessible from the main program by setting individual elements in the array, or by setting the entire array at once with a pointer to eight floats. See for yourself:
    http://www.khronos.o...spec_2.0.25.pdf
     
    Page 35:
    It did not appear that the light color and direction was being sent correctly, and more detailed debugging confirmed this.
     
    After a few hours of testing, I finally determined that uniform array names on iOS have end with '[0]' (I didn't test any other element indexes, at least on the iOS simulator. My provisioning profile just expired, and that's a whole other story...), and just setting the uniform array at once with the name will not work. On the Samsung Galaxy Tab, the situation is reversed. My HTC Evo is the only device that follows the OpenGLES specification and allows either.
     
    Samsung Galaxy Tab: "lightdirection"
    iOS: "lightdirection[0]"
    Evo: "lightdirection" or "lightdirection[0]" (as it should)
     
    The solution? I'll just avoid using uniform arrays on any mobile devices. It's not hard to avoid now that I know what to look for, but it's hell figuring out which parts of the GL spec the driver authors ignored.
     
    Fortunately, you don't have to worry about any of that, so you can just make your games and be happy.

  22. Josh
    As the founder of Leadwerks Software, software piracy is an issue that has directly affected my income. We solved the piracy problem by turning our product into a service. Only paid customers can access our community website and get full use of our product. Piracy rates dropped to virtually zero after that. I consider our piracy problem totally solved. The marketplace changed, we adapted to provide a better service, and overall both the customers and company are better off than before.
     
    Netflix, iTunes, and Steam proved that paid services can compete and win against piracy sites. Unfortunately, the copyright holders have been resistant to this model. They won't distribute their movies through Netflix, nor will they set up their own movie streaming system. Digital streaming media isn't the future, it's the present. Many copyright holders are choosing not to compete in the marketplace, then crying foul when no one participates in their archaic business models.
     
    Why are copyright holders choosing not to compete in the standard distribution model for digital media? It's because they don't want a level playing field. They enjoyed a monopoly on everything you watch, read, hear, and think for decades. They can't stand a free market, which is what the Internet allows. The idea that an artist, product, or idea could become popular by organic means outside their control is terrifying to them. They only want you to have the choices and ideas they create for you: Justin Beiber, Republican/Democrat, and McDonald's.
     
    Old media's death is imminent within the next 10-15 years unless they act now. SOPA is about handing the Internet over to old media. I don't know exactly how it will play out, but we know their ultimate dream is to limit you to a handful of "channels" all owned by the same company. This bill has nothing to do with piracy, and everything to do with control and censorship.
     


  23. Josh
    I've made more progress on the model editor. I needed it to be able to resave models after making changes. First, I started with an Entity::Save function that would save all entities in the GMF format. "But wait", I thought, "I can save all entities in the GMF format!" Then I thought, even better, I can simply write a Serialize() virtual class function in the base object and extend it for each class, so that instead of writing this:

    stream->WriteFloat(position.x); stream->WriteFloat(position.y); stream->WriteFloat(position.z);
    I can simply write this:

    position.Serialize(stream);
    "I am so smart! I am so smart! S-M-R-T!"
     
    Wait a minute, if I write a World::Serialize function, I could save an entire world with all entities in a single file, so that another person can just open the file and recreate everything that was happening! Amazing!
     
    Of course, serializing every instance of every texture would be terribly wasteful. Should assets still be loaded from files? What if they were missing? What about models that were loaded and then modified? Can I use this for sending entities over the network? How does this all fit together?
     
    It was around that time my conscience started kicking in, or whatever that feeling you get when you know you're doing something dumb is. So I stopped what I was doing, imported the GMFSDK code into the editor, and wrote a SaveModel() function, which is all I needed in the first place.
     
    I changed the default background color to dark gray (0.25). It makes thumbnails more easily visible, and is dark enough to not kill your ability to see dark pixels. The thumbnail generation uses the last rotation you had in the model editor, so it's very easy to adjust the thumbnail. The thumbnail renders use an orthographic view, which makes it easier to make better use of the available pixel space, and seems to look good. Thumbnail renders for materials and models use 2x antialiasing, which looks great blended against the background color.
     
    The thumbnail icon view we use for assets is one of my favorite parts of the editor. Having used this and a few alternatives for a while, I think this gives you much faster and easier access to all your files.
     

  24. Josh
    When you double-click a model file in the asset browser, it's opened up in the model editor window within Leadwerks3D. You can drag materials onto a model to assign them, then just save the model and close the window. You can also drag textures straight onto the model, and Leadwerks3D will do a pretty good job of guessing what material to use. If no material exists, it will create one, and take a good guess at what textures should be added to it, then apply the newly created material to the model.
     


  25. Josh
    It's pretty amazing how long the materials, textures, and shader system is taking, but it encompasses a lot of areas: Automatic asset reloading, autogenerated shaders, GLSL syntax highlighting, texture conversion options, and more. All this attention to detail is shaping up to create what I hope will be the best art pipeline, ever.
     
    The Asset Browser displays all files in your project directory. You don't have to use Windows Explorer at all anymore. You can rename, move, copy, cut, paste, and delete files, without ever leaving the editor:

     
    All recognized asset files are displayed in the editor, including materials, textures, shaders, sounds, scripts, models, and fonts:

     
    You can edit textures, materials, and shaders, and see how your changes interact in real-time:

×
×
  • Create New...