Jump to content
  • Advertisement
    1. Past hour
    2. Vilem Otte

      Back-projection soft shadows

      So, I implemented sort-of backprojection that works in stochastic manner (requiring a lot less steps) - as when I did it per-original implementation I was getting up to 4000 iterations per pixel, which is a no-go for performance. The original idea of back-projection is that we have an area light of specific area A, and we project back texels from depth map calculating how much you overlap this area and subtract from it. This will end up in severe light leaking and really bad performance (simply because there is too many texels to walk through). To improve performance you can have mip-chain for shadow map (with min-max trees stored in there), which can significantly improve performance - yet it seems way too complex to me. Instead, I tried to implement stochastic approach to back-projection. Which is simply performing ray-casts against depth map (again min-max trees for shadow maps can help here with performance). Starting off with picking N (in showed cases 32) samples on area light, and performing a ray cast against depth map whether we find any intersection on way towards light. The results seem quite promising, yet suffers from the same problem as PCSS - with growing light size, performance drops - see following 4 images (and notice the fps in top-right corner). This was with brute-force ray-casting with 64 steps - I didn't use the hierarchical representation I have to my advantage (although that will complicate traversal further!). I still have some small bug in the code that over-does my internal umbra (I intentionally darked penumbra part - as it looks like only outer penumbra is calculated properly, while the inner one is always at full shadow strength - even where it shouldn't be), so I'll check whether something can be done with that. Other than that while this is usable for larger area lights, it still doesn't deliver the results I'd expect (or at performance I would expect).
    3. rip-off

      C# variable name creates error

      One reason for this is to prevent ambiguities. Numeric literals can have a suffix to indicate their type, e.g 42l. Without a rule saying that identifiers don't start with a number, it may not be clear if such tokens were identifiers or literals.
    4. Looks like this would have been a very long conversation, but let's just stick to the topic. To make my answer short, I find that Blitz3d has all the capabilities I'm looking for, to make a video game. The extra "data types" are auto declared by context in Blitz3d, like in natural language, so no need to write extra code for it. The only capability I don't find in Blitz3d is the advanced graphics rendering which I don't need. The script you wrote for Unity, Could you write it in Javascript, please ?
    5. djsteffey

      Grass Munchers

      On Google Play at https://play.google.com/store/apps/details?id=djs.game.slide Grass Munchers is a unique casual puzzle game where you must guide your animals around the farm to munch all the grass. The fast pace of play and nearly endless levels will keep you munching grass....until the cows come home.Features:- Easy swipe controls- 10000 unique levels- Leaderboards- Achievements- Unlockable Animals- Powerups- Retro pixel art- Upbeat musicHow To Play:1- Swipe left/right/up/down to move all animals in the direction swiped.2 - Animals will continue munching grass in the direction swiped until they hit an obstacle.3 - Munch grass until no moves available to complete the level. Earn stars and coins based on how much you munch.4 - If you get stuck then you can use the Grass Powerup to regrow grass on a dirt tile.5 - Use earned coins to purchase new animals and powerups in the shop.
    6. Today
    7. Alberth

      Assertion failed in pathfind (c++)?

      I would start by checking that all costs you give to the path finder are sane. If they are not, your code is broken. If it is, the pathfinder itself is broken, ie divide and conqueror. The value must come from somewhere. Best option is being able to point out where it is wrong, second best is eliminating as much code as possible that is not the problem. Any code that remains must then be wrong or act wrong by deduction. Repeat this divide/conqueror step until you found the cause. One way of doing that is to add assert statements that limit the acceptable range of those values. Be sure not to build in release mode, since assert then silently disappears 😛
    8. vinterberg

      ball isn't spawning where desired

      It seems to me that you use newBall.transform.position without initialising it, in your SpecialShot() function?
    9. Distractions! When people interupt me with an attitude of "yeah, just stop that for a minute and listen to me" I can become quite nasty...
    10. I tink this https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification has been implemented with the same application in mind (marching cubes results), IIRC.
    11. I fixed the problem by modifying into this. XMVECTOR Sun = XMVector4Normalize(XMVectorSet(cos(Theta)*cos(Phi), sin(Theta), -cos(Theta)*sin(Phi), 0)); the minus sign worked fine.
    12. benjamin1441

      As a game dev, what are you most afraid of?

      Coding! Yes, always have a healthy fear of the Microsoft.
    13. KKTHXBYE

      ball isn't spawning where desired

      Aint you should subtract paddle pos from ball pos to have ball local coordinates and instead of using newBall.GetComponent<Ball>().paddleToBallVector; Of which you didnt provide the code for Use that result instead?
    14. Output.PSPosition = mul(float4(Input.LSPosition, 1.0f), mWorld); Output.PSPosition = mul(Output.PSPosition, mView); Output.PSPosition = mul(Output.PSPosition, mProjection); here it seems its all wrong you pass modelview projection matrix and multiple (dot) by it, instead you muktipke position by 3 diff matrices dont know the order of matrix multiplication because i have no idea what kind of matrix you use
    15. davejones

      C# variable name creates error

      Thank you for your book recommendation. I will purchase the book you have recommended and make it a go to reference on a daily basis where I am coding. So when I am coding I'll refer to it and make annotations notes on what I feel is optimum.
    16. davejones

      Keep object in camera view

      I want the camera to be restricted in terms of the area it can move around in. The video I posted shows how I would want tracking to behave. So yes I do wan't the tracking to be restricted. This is so that the camera isn't able to track an infinite distance away from the target object. In terms of yaw and pitch it is possible to yaw and pitch out of sight of the target. This isn't much of an issue. My goal is to keep the camera bounded within a certain area for pitch, roll and yaw.
    17. marcus12

      Solbot Energy Rush

      "Solbot Energy Rush" is a Casual and Fun Mobile Game for all age groups. Play as a Color Switching Robot whose suit color changes every level and Player has to collect the same matching colored orbs. 🚀🚀 It's really challenging but fun, once you get familiar 📣📣📣 Feature: One touch control 50 Unique and challenging levels Multiple fun power ups Free and easy to play Key to victory is timing and precision of movement More fun and challenging factors to explore - so get your hands on Solbot, as the fun never stops! 👾 👇🏽👇🏽 Android: https://play.google.com/store/apps/details?id=com.freakoutgames.chromaflyer 👇🏽👇🏽 iOS: https://itunes.apple.com/us/app/solbot-energy-rush/id1368418939?ls=1&mt=8
    18. Bugs in the multi-threading code.
    19. Nypyren

      As a game dev, what are you most afraid of?

      Making mobile games that have more stats-tracking and multivariate analysis code than actual game code.
    20. suliman

      Assertion failed in pathfind (c++)?

      Yes the value of totalCost is 3.40282347e+038. I guess that's the max value of the float? Im not sure how it becomes this however. I found out this: 1. It happens when I try to add the first node during solving the pathfind (see below). The code continues but it crashes with that "open.Push()" function (which adds the starting node I guess). int MicroPather::Solve( void* startNode, void* endNode, vector< void* >* path, float* cost ) { #ifdef DEBUG_PATH printf( "Path: " ); graph->PrintStateInfo( startNode ); printf( " --> " ); graph->PrintStateInfo( endNode ); printf( " min cost=%f\n", graph->LeastCostEstimate( startNode, endNode ) ); #endif *cost = 0.0f; if ( startNode == endNode ) return START_END_SAME; ++frame; // // In "reuse" mode, reset the costs. // if ( pathNodeMem ) // ReuseAll(); OpenQueue open( graph ); ClosedSet closed( graph ); open.Push( NewPathNode( startNode, // node 0, // cost from start graph->LeastCostEstimate( startNode, endNode ), 0 ) ); 2. The NewPathNode returns a node with totalCost = 3.40282347e+038 which causes the problem. See below (function continues but the "return root" at the bottom is returning the node with the strange totalCost already. PathNode* MicroPather::NewPathNode( void* state, float costFromStart, float estToEnd, PathNode* parent ) { // Try to find an existing node for this state. unsigned key = Hash( (unsigned) state ); //(HASH_SIZE-1) & ( (unsigned)state + (((unsigned)state)>>8) + (((unsigned)state)>>16) + (((unsigned)state)>>24) ); if ( !hashTable[key] ) { // There isn't even a hashtable yet - create and initialize the PathNode. hashTable[key] = AllocatePathNode(); hashTable[key]->Init( frame, state, costFromStart, estToEnd, parent ); return hashTable[key]; } PathNode* root = hashTable[key]; PathNode* up = 0; while ( root ) { up = root; if ( root->state == state ) { root->Reuse( frame, costFromStart, estToEnd, parent ); assert( root->state == state ); return root; } Im kind of at a loss here...
    21. JoeJ

      Distance Fields

      https://docs.unrealengine.com/en-us/Engine/Rendering/LightingAndShadows/DistanceFieldAmbientOcclusion They mention to calculate a list of tiles for each individual object (close objects only, distant stuff uses global SDF). Likely they precompute min/max depth per tile to determinate how much to extrude bounds for objects, to avoid missing objects that are near, but do not intersect the tile. No, it should be enough to extrude the bounds by distance to camera to guarantee including all affected tiles. So you could calculate the tile list by rasterizing the extruded bounding boxes. I assume they then run AO compute shader per object tile (no pixel shader), and results accumulate to screen by using atomics. Edit: Hodgman only describes the global SDF, which they mention to be implemented with scrolling. But the detailed individual objects are still used near the camera, and cause the most performance cost. I assume they mix both approaches by distance to camera. Not sure of anything, but you could look at the source.
    22. JoeJ

      Back-projection soft shadows

      CryEngine has this feature running IIRC (voxelization but no SDF), but their manual pages seem to be down at the moment.
    23. Developer Dre Reid

      As a game dev, what are you most afraid of?

      I guess it would be pirates and not making enough money.
    24. VS_OUTPUT VSMAIN(VS_IN Input) { VS_OUTPUT Output = (VS_OUTPUT)0; Output.PSPosition = mul(float4(Input.LSPosition, 1.0f), mWorld); Output.PSPosition = mul(Output.PSPosition, mView); Output.PSPosition = mul(Output.PSPosition, mProjection); Output.TextureCoords = Input.TextureCoords; Output.LSNormal = mul(float4(Input.LSNormal, 0.0f), mWorld); Output.LSNormal = normalize(Output.LSNormal); Output.LightVP = mul(float4(Input.LSPosition, 1.0f), mWorld); Output.LightVP = mul(Output.LightVP, mLightView); Output.LightVP = mul(Output.LightVP, mLightProjection); //Orthographic Projection .......
    25. Zakwayda

      Assertion failed in pathfind (c++)?

      Can you step through using the debugger and see what value for totalCost is causing the problem? It doesn't seem like there'd be many values of type float for which x < FLT_MAX would return false. FLT_MAX of course, maybe NaN. So it seems totalCost has become corrupted somehow or otherwise has an unexpected value. Presumably you're providing the G and H costs, in which case you could also add checks in your own code (if you don't have them already) to make sure those are sane.
    26. That would be a very bad idea for a serious game engine. In fact it can be said that the reason Blitz3D didn't make it as a game engine is because it kept omitting data types and never provided necessary libraries to provide the data type functions. Some data types are similar but have very different jobs. Take Color VS Vector3 both look like this: Red = Color(1,0,0) and Right = Vector3(1,0,0). A Vector3 has a length that we use like this: Vector3(1,0,0).length( ) this will return 1. Color doesn't have any concept of length, it in turn has handy color functions like Color(1, 0, 0).contrasted() that tells us the contrast level of the color. There is also differences in how these lerp and other mathematical expressions. That is why Godot doesn't omit these data types, so that you can use them as intended. Blitz3D isn't using a natural programming engine. It is a full code based engine, using BlitzMax that is derived from Basic speed = (0,0,0) If Keydown(up_key) = true Then speed.y = speed.y +1; MoveEntity Object speed This code works in Blitz3D because it understands programming. It was just a simpler engine, intended as a stepping stone for moving to more advanced engines like Godot. If we look at the Godot example it can be made the same way: var Speed = Vector3(0,0,0) if Input.is_action_pressed("ui_up") == true : Speed.y += 1 move_and_slide(Speed) Yes it does look a little different but that is because it can do more things. Once you notice that the : symbol just means Then it is easy to understand why : is used instead. Because in Godot a Then function can do a list of things, like this: if Input.is_action_pressed("ui_up") == true : Speed.y += 1 Speed.y = 1 / 2 Speed.y = Speed.y +1 All three those calculations will now run when the up key is pressed. Think of the : symbol as it is used when writing and you will see it is the same concept. Once you have learned how to use Godot, you will see that if you go back to Blitz3D you will be able to do a lot of things you didn't know Blitz3D could do. But "Is_action_pressed" doesn't only refer to keyboard keys. It could be a finger pressing a touchpad, or a game controller joystick that can be pressed down and even a lever like the ones found on controllers. "Key_down" would have been confusing; as it is only a key on a computer keyboard. This doesn't surprise me, I have seen professional C++ programmer's struggle with Python. It's like a mountaineer coming fully dressed in climbing gear, only to find a hill. In Unity the variables also need declaring, yet again this is because it has a lot of extras for each data type: public float Speed = 100f; void MoveObject(float XAxis, float YAxis){ TempVec = new vector3(0,0,0); TempVec.x += XAxis * Speed * Time.DeltaTime; TempVec.y += YAxis * Speed * Time.DeltaTime; this.transform.position() += TempVec; } void Update(){ MoveObject(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical")); } As you can see there is a lot more to C# scripting than there is to GDScript or Blitz. The advantage of the Unity one is that you get pressure sensitivity; the harder the button is pressed the more the object moves.
    27. Hi! Im using a a-star pathfinder from the web ("micropather") and I've run into a problem in one of my projects using it and i'm stuck. Maybe you can give me a hint on where to look for the error? This is the problem I get: It happens every time after one agent pathfinds and another one tries to do it again. The first agent can always pathfind without problems, the second one always spawns this message. I happens when the pather tries to push a new node to the open open list if that says anything. The failed assertion comes from: // Add sorted. Lowest to highest cost path. Note that the sentinel has // a value of FLT_MAX, so it should always be sorted in. assert( pNode->totalCost < FLT_MAX ); The pathfinder works fine in other projects so I guess I made something wrong in this project but I've looked alot for possible errors... Thank yo for any help you may provide! Erik
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!