Jump to content

Josh

Staff
  • Posts

    24,155
  • Joined

  • Last visited

Everything posted by Josh

  1. Josh

    Model request

    It actually doesn't matter where on the drawer the pivot is, as long as the tag you place in the desk mesh matches the position of the drawer pivot, so the drawer appears in the right place.
  2. Here, the program creates a skybox just by loading the environment_atmosphere model. Make sure you have the scripts folder copied to your project directory: // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #include "engine.h" int main( int argn, char* argv[] ) { Initialize() ; RegisterAbstractPath("C:/Leadwerks Engine SDK"); SetAppTitle( "luatest" ) ; Graphics( 800, 600 ) ; AFilter() ; TFilter() ; TWorld world; TBuffer gbuffer; TCamera camera; TMesh mesh; TLight light; TMesh ground; TMaterial material; world = CreateWorld() ; if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); return Terminate(); } TFramework framework=CreateFramework(); TLayer layer = GetFrameworkLayer(0); camera=GetLayerCamera(layer); PositionEntity(camera,Vec3(0,0,-2)); //Set Lua variable BP L=GetLuaState(); lua_pushobject(L,framework); lua_setglobal(L,"fw"); lua_pop(L,1); LoadModel("abstract::environment_atmosphere.gmf"); material=LoadMaterial("abstract::cobblestones.mat"); mesh=CreateCube(); PaintEntity(mesh,material); ground=CreateCube(); ScaleEntity(ground,Vec3(10,1,10)); PositionEntity(ground,Vec3(0,-2,0)); PaintEntity(ground,material); light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // Rotate cube TurnEntity( mesh, Vec3( 0.5f*AppSpeed() ) ) ; // Update timing and world UpdateFramework(); // Render RenderFramework(); // Send to screen Flip(0) ; } } // Done return Terminate() ; }
  3. // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #include "engine.h" int main( int argn, char* argv[] ) { Initialize() ; RegisterAbstractPath("C:/Leadwerks Engine SDK"); SetAppTitle( "luatest" ) ; Graphics( 800, 600 ) ; AFilter() ; TFilter() ; TWorld world; TBuffer gbuffer; TCamera camera; TMesh mesh; TLight light; TMesh ground; TMaterial material; world = CreateWorld() ; if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); return Terminate(); } TFramework framework=CreateFramework(); TLayer layer = GetFrameworkLayer(0); camera=GetLayerCamera(layer); PositionEntity(camera,Vec3(0,0,-2)); material=LoadMaterial("abstract::cobblestones.mat"); mesh=CreateCube(); PaintEntity(mesh,material); ground=CreateCube(); ScaleEntity(ground,Vec3(10,1,10)); PositionEntity(ground,Vec3(0,-2,0)); PaintEntity(ground,material); light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // Rotate cube TurnEntity( mesh, Vec3( 0.5f*AppSpeed() ) ) ; // Update timing and world UpdateFramework(); // Render RenderFramework(); // Send to screen Flip(0) ; } } // Done return Terminate() ; }
  4. It's just a limitation of the way the renderer works. 3D World Studio is designed to work on very old graphics hardware, and it doesn't have very good blending abilities. This won't affect how the terrain looks when you run it in DBPro or another program.
  5. Josh

    Important Update

    Something similar to this was seen in beta testing. It was solved by clamping some values...just need to find out exactly where.
  6. Josh

    Model request

    The green one is correct. Just make sure the pivot you add for the drawer in the desk model is in the same place. The type of drawer should be a separate model, with a convex hull .phy file. If any drawers are the same, I can load another copy of the model. Here's what I am going to do in code: drawerpivot=object.model:FindChild("drawer") drawer=LoadModel("abstract::furniture_desk_drawer1.gmf") drawer:SetPosition(drawerpivot:GetPosition(1),1) drawerjoint=CreateJointSlider(object.model,drawer,Vec3(0,0,1) drawerjoint:SetLimits(0,0.6) --or whatever amount looks good The doors in the tunnels scene will open like Penumbra if you just fly up to them in the editor, hold the shift key, and click and drag them with the mouse. I would not worry about LOD at this point. Let's see if this even works first! Looks pretty nice so far.
  7. I would do your animation in the object:Render() function. That way animation only has to be performed on models that actually get drawn.
  8. I added the missing module to the server, too.
  9. Josh

    Important Update

    Finishing the framework docs today...
  10. Last time I talked to the author, he said he was having trouble getting a response from Valve, so it being on Steam is news to me. I'm glad it worked out for them. Penumbra is the model of an efficient and successful low-budget game. Everything about it is designed to minimize required production resources and maximize the depth of experience. For example, use of an intercom system allows them to have personal interaction with another character, and the only resources it requires are voice acting.
  11. Josh

    flip hook

    It's used in hooks.lua.
  12. We're finishing up 2009 by resolving some longstanding design issues that haven't been particularly critical, but have weighted on my mind. Framework is not like the main engine. It's far more high-level, and is also the kind of code people want to customize. I don't like locking the user into my way of doing things. However, the interaction between Lua, C++, and Framework commands are a real issue, which we started to see immediately as Lua became available. This was resolved by compiling Framework into the engine DLL and providing the source code in the BMX folder. Most people will be happy with the default settings, but a few will want to write their own renderers, and fortunately they still can. Most importantly, Lua can access the Framework commands, so all the water and atmospheric effects will work the same in C++ and in the editor. In the end, we finally wound up doing something I said we never would: There are commands like SetBloom(), SetNearDOF(), etc. However, since this is open-source code built on top of the buffer and shader systems, I am happy with it. The user still has low-level power, but is supported by a lot of default code that does most of what they want. This is the design I have always tried to provide. The solution we arrived at with Framework can also be applied to other systems that are commonly needed, yet don't quite fit into the main engine. Providing open-source code, and then compiling it into the DLL and adding a Lua interface seems to be a good solution for anything like this. The next system I could see handled this way is AI. I am carefully watching the work Chris Paulson is doing with the recast library, and I think it has a very promising future. Oh, and in other news Penumbra is finally available on Steam! Penumbra is a physics-driven game that uses the same physics library we use, Newton Game Dynamics. I highly recommend this series, both for learning and for fun.
  13. There's an update available now. This compiles the Framework commands into the main engine so that Lua can access the entire framework command set. C++ programs will now more closely resemble the results you see in the editor, because water, sky, and other settings can be controlled with Lua and any programming language.
  14. This example shows how to use BlitzMax, Framework, and Lua together seamlessly! Framework is a little different from the main engine. Although it is compiled into the DLL, it is not compiled into the engine module. This allows the programmer to make their own customizations to the code. However, it also means we have to generate a code file of glue functions for Lua to be able to access the Framework commands. The attached example shows how to do this. You can also use this method to expose your own BlitzMax types to Lua! Any time your command set changes, you need to regenerate the Lua glue code. This is done by commenting out the line that includes the glue code, and uncommenting the code that generates it: 'Include "lua-gluefunctions.bmx" generateGlueCode("lua-gluefunctions.bmx") End Then switch the comments back to run the program: Include "lua-gluefunctions.bmx" 'generateGlueCode("lua-gluefunctions.bmx") 'End This allows your Lua scripts to access the entire framework command set, as well as your own types. You also need to set the value of the global Lua variable "fw". This is done with the included SetScriptObject() function, which just uses Lua commands to set a variable. The Framework code is distributed as code files instead of a module, mostly because BlitzMax does not allow compiling a module with the name "Framework". fwtest.zip
  15. You might want to start with a simple hard-coded app to see if this idea actually works, before you start adding a UI. I have no idea if the results will be useful or not.
  16. Yeah, I think this is a good idea. Maybe an SBX can be saved as a model + automatically generated script. Until then, I recommend creating pivots in the mesh, and then using FindChild() to see where the lights should be positioned.
  17. Ha, that is brilliant! You could start with a photo and have a program that enters all the unique values into an image to make the palette. Here's my attempt. I just resized the image (using pixel resize, so there is no blending of colors). I scaled it back up so it was easier to see.
  18. Use the Quake palette to test with.
  19. Solutions like that result in loss of resolution, which is why things start looking washed out instead of warm. We want consistency of similar hues, not a loss of resolution. Notice the colors are different, but look somehow consistent: Here's a good example of "random colors syndrome": Here is the same image multiplied by an orange tint. This looks like a lot of the screenshots I have seen. Even though the tint sort of forces it to look consistent, there is a loss of resolution and the odd colors still look odd: Relying too much on colored lighting only washes out detail and makes everything look muddy.
  20. One problem I notice a lot is inconsistency in coloration of scenes. The recent contrast/saturation/brightness controls I added help a bit, but I think the original texture data has to be consistent. If you look at most AAA games, their textures somehow have a uniform appearance, and they just look like they belong together. Unfortunately, we seem to have a lot of problems doing this. Here is the palette from the game "Quake": And an example of consistent textures, even if it is a little extreme: Here's an idea I had that might help with this problem: First, you define a palette of colors. Maybe this can be a 32x32 image with different browns, greens, blues, etc. for each pixel. It doesn't matter what order they are in. You just define some colors that look good together. This programs loads this image and reads the pixels into different possible values. They can be converted to HSL and stored. Then the program starts loading a directory of textures, recursively. For each image found, it does the following: For each pixel of an image, it converts the pixel to HSL. Then it compares the pixel hue and saturation to the values of the palette, and finds the closest match. Then it saves a new copy of the image, using the replaced hue and saturation values, and retaining the original brightness value. You could use this to make all your greens look similar. It might automatically create a consistent color theme, something that we developers seem to have a very hard time with. If you don't like the results, edit your palette image and re-run the application. I don't have time to write something like this, but I thought I would put the idea out there.
  21. This is a known problem. I have to redo some of the vegetation rendering stuff soon, so it will be resolved at that time. Nice scene, BTW!
  22. The trees appear to have no specular reflection. Your ambient light level is very bright and isn't tinted blue. I'd also enable edge antialiasing.
×
×
  • Create New...