Jump to content

Happenstance

Members
  • Posts

    105
  • Joined

  • Last visited

Everything posted by Happenstance

  1. Might be helpful: https://www.garagegames.com/community/resources/view/22970
  2. Sounds like VectorLen() is what you're looking for. I believe 'speed' is just the magnitude of a velocity vector, which is what VectorLen returns, and will always be a positive number.
  3. Can you post a snippet or screenshot of the console log to show the problem? I just tried calling the above on a bunch of random velocities but couldn't reproduce the problem. Also, what're you using the above code for? Might help figuring out what's happening.
  4. This is definitely helpful and gives me a better idea of where the E/C systems are at. @Azaezel also provided me with a basic SoundComponent last night to look over. I think at this point I'm going to try putting a couple basic entities together just to see how everything fits together. I think eventually working my way up to a fully functioning Item object (renders a mesh, spins, reacts to collision) sounds like a reasonable goal.
  5. I'd like to modify the SkyBox class to blend between two (or more) cubemaps depending on time of day. I've hacked up ScatterSky to do this (have it fading between a day & night cubemap in the shader right now) but it feels like overkill for what I need. ScatterSky does a lot of work simulating light scattering, ambient colors, sun corona, etc. and also has a weird dome shape that doesn't match up well against the horizon. SkyBox and ScatterSky use cubemaps differently and I don't have a good enough grasp of T3D's rendering system to know where to start. SkyBox uses a BaseMatInstance to hold the cubemap material and calls setupPass() whereas ScatterSky uses CubemapData and calls GFX->setCubeTexture(). Has anyone done anything like this before?
  6. So zOffset for ScatterSky has been broken for a while. I looked through the git history and the relevant change was going from this in 3.8: Point3F camPos2 = state->getCameraPosition(); MatrixF xfm(true); xfm.setPosition(camPos2 - Point3F( 0, 0, mZOffset)); GFX->multWorld(xfm); MatrixF xform(proj);//GFX->getProjectionMatrix()); xform *= GFX->getViewMatrix(); xform *= GFX->getWorldMatrix(); to this as part of rextimmy's D3D11 commit (41e5caf): Point3F camPos2 = state->getCameraPosition(); MatrixF xfm(true); GFX->multWorld(xfm); MatrixF xform(proj);//GFX->getProjectionMatrix()); xform *= GFX->getViewMatrix(); xform *= GFX->getWorldMatrix(); if(state->isReflectPass()) { static MatrixF rotMat(EulerF(0.0, 0.0, M_PI_F)); xform.mul(rotMat); rotMat.set(EulerF(M_PI_F, 0.0, 0.0)); xform.mul(rotMat); } xform.setPosition(xform.getPosition() - Point3F(0, 0, mZOffset)); I can get zOffset working again by removing: xform.setPosition(xform.getPosition() - Point3F(0, 0, mZoffset)); and replacing it with: xfm.setPosition(camPos2 - Point3F(0, 0, mZoffset)); but matrices are not my strong suit so I feel like I'm overlooking something (probably breaking reflections somehow?). Anyone see anything wrong this?
  7. Yep, that was it Steve. I'd rotated it correctly but hadn't applied the rotation before exporting so I was literally looking at the thing edge-on in the game.
  8. That's an interesting idea. I'm thinking you'd probably have better luck importing the LIDAR data into a modeling app (I vaguely remember someone doing something similar in Blender) and trying to export a mesh from there into T3D. You'll probably need to write a custom class as well that handles actually rendering the points, which I'm assuming would exported as simple vertices. The objects in the T3D/examples folder would be a good starting point.
  9. Thanks - that's made it look much closer to how I'd expect.
  10. Could you take a screenshot of where the option is? Maybe I'm overlooking it. This is what I'm seeing (build based on dev branch as of 6/25): http://www.jesterdance.com/srgb_huh.jpg
  11. Thanks. I don't seem to have the sRGB checkbox on my end but that's a good starting point.
  12. Anyone noticed textures rendering differently on skyboxes than normal shapes? Here's what I'm seeing on my end using latest dev branch (but also tried in 3.10.1 as well - same issue). http://www.jesterdance.com/t3d-weirdsky.png On the left is the texture in paint.net, the cube on the right is a TSStatic textured with the same tex and behind it is the skybox also using the same texture. The skybox colors are off somehow. Tried with other cubemaps as well, including the night sky which renders as brighter and more washed out than it's supposed to be.
  13. Apparently using a plane (even double sided) is bad voodoo for billboards. Tried with a simple cube and things are working nicely. Edit: I see what's happening now. I rotated the plane in Blender but forgot to apply rotation before exporting so I actually was looking at it edge-on in game. The cube worked because it has depth so every angle was visible. Derp! @Duion - And thanks, I'd forgotten about being able to change billboarding in the shape editor. Made finding the problem easier.
  14. I'm trying to create a dust field using a bunch of textured planes that I want to orient to face the camera. I'm exporting the mesh from Blender and adding the BB:: prefix to the name so the DAE importer automatically sets it to billboard. In game, the mesh is invisible unless I disable billboarding (or enable Z-axis billboarding which works but isn't the effect I want). If I go into wireframe mode I can see a thin line where the mesh should be, almost like the code is turning the mesh on its side and I'm looking at it from one of the edges. I've tried everything I can think of - changing the 'up' axis on import, flipping normals, rotating the mesh before export... nothing seems to make a difference. Anyone have any experience setting up DTS billboards?
  15. I believe Basic Lighting is setup to only render shadows from ShapeBase-derived objects (that'll be StaticShapes, Player, Item, etc.). You can change this in the engine but BL shadows should be used sparingly, ideally only for a few dynamic objects. Advanced Lighting is really the way to go if you're looking to have an entire scene rendered with realtime lights and shadows.
  16. What happens if you call getMuzzlePoint/Vector instead of getRenderMuzzlePoint/Vector? Also is animateOnServer set to true in the weapon datablock?
  17. Thoughts on just replacing handleCommandLine() with something like: bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv ) { // Allow the window manager to process command line inputs; this is // done to let web plugin functionality happen in a fairly transparent way. PlatformWindowManager::get()->processCmdLineArgs(argc, argv); Process::handleCommandLine( argc, argv ); // Set up the command line args for the console scripts... Con::setIntVariable("Game::argc", argc); U32 i; for (i = 0; i < argc; i++) Con::setVariable(avar("Game::argv%d", i), argv); // Execute entry file if found, otherwise fail and exit the app. if (Platform::isFile("./main.cs") || Platform::isFile("./main.cs.dso")) { const char *entryCmd = "exec(\"./main.cs\");"; Con::evaluatef(entryCmd); return true; } return false; } This seems a lot cleaner to me and also allows main.cs to compile to a dso.
  18. So this is kind of ugly. The code jumps through hoops supporting custom entry scripts being passed in via commandline and what I assume is an older version of zip support (TORQUE_ENABLE_VFS) which isn't used anywhere else. bool StandardMainLoop::handleCommandLine( S32 argc, const char **argv ) { // Allow the window manager to process command line inputs; this is // done to let web plugin functionality happen in a fairly transparent way. PlatformWindowManager::get()->processCmdLineArgs(argc, argv); Process::handleCommandLine( argc, argv ); // Set up the command line args for the console scripts... Con::setIntVariable("Game::argc", argc); U32 i; for (i = 0; i < argc; i++) Con::setVariable(avar("Game::argv%d", i), argv); #ifdef TORQUE_PLAYER if(argc > 2 && dStricmp(argv[1], "-project") == 0) { char playerPath[1024]; Platform::makeFullPathName(argv[2], playerPath, sizeof(playerPath)); Platform::setCurrentDirectory(playerPath); argv += 2; argc -= 2; // Re-locate the game:/ asset mount. Torque::FS::Unmount( "game" ); Torque::FS::Mount( "game", Platform::FS::createNativeFS( playerPath ) ); } #endif // Executes an entry script file. This is "main.cs" // by default, but any file name (with no whitespace // in it) may be run if it is specified as the first // command-line parameter. The script used, default // or otherwise, is not compiled and is loaded here // directly because the resource system restricts // access to the "root" directory. #ifdef TORQUE_ENABLE_VFS Zip::ZipArchive *vfs = openEmbeddedVFSArchive(); bool useVFS = vfs != NULL; #endif Stream *mainCsStream = NULL; // The working filestream. FileStream str; const char *defaultScriptName = "main.cs"; bool useDefaultScript = true; // Check if any command-line parameters were passed (the first is just the app name). if (argc > 1) { // If so, check if the first parameter is a file to open. if ( (dStrcmp(argv[1], "") != 0 ) && (str.open(argv[1], Torque::FS::File::Read)) ) { // If it opens, we assume it is the script to run. useDefaultScript = false; #ifdef TORQUE_ENABLE_VFS useVFS = false; #endif mainCsStream = &str; } } if (useDefaultScript) { bool success = false; #ifdef TORQUE_ENABLE_VFS if(useVFS) success = (mainCsStream = vfs->openFile(defaultScriptName, Zip::ZipArchive::Read)) != NULL; else #endif success = str.open(defaultScriptName, Torque::FS::File::Read); #if defined( TORQUE_DEBUG ) && defined (TORQUE_TOOLS) && !defined(TORQUE_DEDICATED) && !defined( _XBOX ) if (!success) { OpenFileDialog ofd; FileDialogData &fdd = ofd.getData(); fdd.mFilters = StringTable->insert("Main Entry Script (main.cs)|main.cs|"); fdd.mTitle = StringTable->insert("Locate Game Entry Script"); // Get the user's selection if( !ofd.Execute() ) return false; // Process and update CWD so we can run the selected main.cs S32 pathLen = dStrlen( fdd.mFile ); FrameTemp szPathCopy( pathLen + 1); dStrcpy( szPathCopy, fdd.mFile ); //forwardslash( szPathCopy ); const char *path = dStrrchr(szPathCopy, '/'); if(path) { U32 len = path - (const char*)szPathCopy; szPathCopy[len+1] = 0; Platform::setCurrentDirectory(szPathCopy); // Re-locate the game:/ asset mount. Torque::FS::Unmount( "game" ); Torque::FS::Mount( "game", Platform::FS::createNativeFS( ( const char* ) szPathCopy ) ); success = str.open(fdd.mFile, Torque::FS::File::Read); if(success) defaultScriptName = fdd.mFile; } } #endif if( !success ) { char msg[1024]; dSprintf(msg, sizeof(msg), "Failed to open \"%s\".", defaultScriptName); Platform::AlertOK("Error", msg); #ifdef TORQUE_ENABLE_VFS closeEmbeddedVFSArchive(); #endif return false; } #ifdef TORQUE_ENABLE_VFS if(! useVFS) #endif mainCsStream = &str; } // This should rarely happen, but lets deal with // it gracefully if it does. if ( mainCsStream == NULL ) return false; U32 size = mainCsStream->getStreamSize(); char *script = new char; mainCsStream->read(size, script); #ifdef TORQUE_ENABLE_VFS if(useVFS) vfs->closeFile(mainCsStream); else #endif str.close(); script = 0; char buffer[1024], *ptr; Platform::makeFullPathName(useDefaultScript ? defaultScriptName : argv[1], buffer, sizeof(buffer), Platform::getCurrentDirectory()); ptr = dStrrchr(buffer, '/'); if(ptr != NULL) *ptr = 0; Platform::setMainDotCsDir(buffer); Platform::setCurrentDirectory(buffer); //Con::evaluate(script, false, useDefaultScript ? defaultScriptName : argv[1]); delete[] script; #ifdef TORQUE_ENABLE_VFS closeEmbeddedVFSArchive(); #endif return true; }
  19. Not many, at least as far as I know. They can create edge artifacts in certain cases and might be tricky to use with baked light depending on how it's done. Apparently Andrew implemented these in Torque6. Think I'll look around and see if there's something that can be ported over.
  20. Using Torque as an example, decals are rendered by creating a new mesh with geometry that conforms to whatever surface you're projecting them on. One of the problems with this method is it fails at extreme angles (think about a corner of a room where the walls meet the ceiling or a highly tessellated boulder) which will cause decals to warp or clip in weird ways. With deferred decals you're essentially projecting the decal texture directly onto the screen so there's no extra geometry to create and no z-fighting or clipping issues to deal with.
  21. Interesting technique for drawing decals in a deferred renderer: http://martindevans.me/game-development/2015/02/27/Drawing-Stuff-On-Other-Stuff-With-Deferred-Screenspace-Decals/ and shader code: https://github.com/martindevans/Myre/blob/master/Myre/Myre.Graphics.Content/Decal.fx Avoids the expense and messiness involved with creating custom geometry that conforms to the underlying surface by just writing directly to the gbuffer.
  22. Interesting. Never heard of this one. Looks like it's a dead project, though? It'd be nice if some of these developers would be more active in the community. I can't help but think there's some good improvements to the engine lurking in the codebases of games like Steam Hammer, Frozen Synapse 2, etc. that we'll never see.
  23. Does raycast return a hit if you don't use a detail level? Does the shape editor show all of the hitboxes when you inspect the model?
  24. This looks interesting, always room for a spy RPG. Looking forward to seeing more. I hadn't heard of Top Secret so I looked it up - looks fun. There's a new version that just came out, might have to look into getting it.
×
×
  • Create New...