
Forum Statistics

Total Topics627753

Total Posts2978946


Similar Content

By evensotrue
Hello there !
We are Team HOF
We've made a horror game called The Factory
Please download it here!
Link: https://gamejolt.com/games/TheFactory/289746
Feedback and comments are appreciated!
Trailer
Controls:
WASD Moving around
FFlashlight
QSliding
Gameplay Find ways to go out from the factory, avoid from the killer

By 7th_Continuum
I'm trying to implement a frictional constraint using position based dynamics, but it is only half working. I am using the formulation in the paper "Unified Particle Physics for RealTime Applications".
Here is my implementation:
Particle *np = particle>nbs[j].neighbour; vec3 r = particle>x  np>x; float r_length = glm::length(r); float distDiff = r_length  restDistance; if(distDiff >= 0 ) continue; //Frictional Constraint vec3 n = r/r_length; vec3 xxi = particle>x  xi[particle>getIndex()]; vec3 xxj = np>x  xi[np>getIndex()]; vec3 tangentialDisplacement = (xxi  xxj)  glm::dot(xxi  xxj, n) * n; float td_length = glm::length(tangentialDisplacement); float genMass = ( imass / (imass + imass) ); if(td_length < (staticFriciton * distDiff)){ particle>x += genMass * tangentialDisplacement; np>x += genMass * tangentialDisplacement; }else{ float upper = kineticFriction * distDiff; particle>x += genMass * tangentialDisplacement * std::min(upper/td_length, 1.f); np>x += genMass * tangentialDisplacement * std::min(upper/td_length, 1.f); }

By ScyllaBus
Using my loop based on this: https://gafferongames.com/post/fix_your_timestep/
Trying to get my game to run at fixed 60FPS (both update and render) for all machines. Studied the link above and have been stuck on this game loop for weeks trying to get it to work smoothly to glide this image across the screen. I had dealt constantly with jittering and possible tearing. I can't recall what I did to fix it exactly, but I believe it may have something to do with not rounding a variable properly (such as delta).
So yeah, currently the loop works but I'm afraid as I develop the game more and have to render more, eventually something I'm doing in my loop could cause slowdowns or larger CPU usage. Does the structure of the game loop below seem okay or is there something I can do to optimize it?
The 2D game is a generic sidescroller. Not too heavy on physics, mainly just simple platformer physics. I feel as though I'm using way too much CPU.
void Game::mainLoop() { double fps = 60.0f; int frameSkip = 5; int deltaSkip = frameSkip; double miliPerFrame = 1000.0 / fps; double xx = 0.0f; double playSpeed = 5; Uint64 previous = SDL_GetPerformanceCounter(); double accumulator = 0.0f; bool shouldRender = false; bool running = true; while(running){ Uint64 current = SDL_GetPerformanceCounter(); double elapsed = (currentprevious) * 1000; elapsed = (double) (elapsed / SDL_GetPerformanceFrequency() ); previous = current; // handleEvents() handleEvents(); // when we press escape reset x to 0 to keep testing // when he goes off screen if(key_states[SDL_SCANCODE_ESCAPE]) xx = 0; accumulator+=elapsed; if(accumulator >= miliPerFrame * frameSkip) accumulator = 0; shouldRender = accumulator >= miliPerFrame; while(accumulator >= miliPerFrame){ // update() //cout << playSpeed << endl; double delta = ceil(elapsed); if(delta > deltaSkip) delta = 1; //if(elapsed >= 1) delta = elapsed; xx+= playSpeed * delta;// * (1 / fps); // /update() accumulator = miliPerFrame; //get what's left over } if(shouldRender){ // render() SDL_SetRenderDrawColor(gameRenderer, 0xFF, 0xFF, 0xFF, 0xFF); SDL_RenderClear(gameRenderer); imageController.drawImage("colorkeytest", floor(xx), 0); SDL_RenderPresent(gameRenderer); // /render() } } }

By schneckerstein
Hello,
I manged so far to implement NVIDIA's NDFFiltering at a basic level (the paper can be found here). Here is my code so far:
//... // project the half vector on the normal (?) float3 hppWS = halfVector / dot(halfVector, geometricNormal) float2 hpp = float2(dot(hppWS, wTangent), dot(hppWS, wBitangent)); // compute the pixel footprint float2x2 dhduv = float2x2(ddx(hpp), ddy(hpp)); // compute the rectangular area of the pixel footprint float2 rectFp = min((abs(dhduv[0]) + abs(dhduv[1])) * 0.5, 0.3); // map the area to ggx roughness float2 covMx = rectFp * rectFp * 2; roughness = sqrt(roughness * roughness + covMx); //... Now I want combine this with LEAN mapping as state in Chapter 5.5 of the NDF paper.
But I struggle to understand what theses sections actually means in Code:
I suppose the firstorder moments are the B coefficent of the LEAN map, however things like
float3 hppWS = halfVector / dot(halfVector, float3(lean_B, 0)); doesn't bring up anything usefull.
Next theres:
This simply means:
// M and B are the coefficents from the LEAN map float2x2 sigma_mat = float2x2( M.x  B.x * B.x, M.z  B.x * B.y, M.z  B.x * B.y, M.y  B.y * B.y); does it?
Finally:
This is the part confuses me the most: how am I suppose to convolute two matrices? I know the concept of convolution in terms of functions, not matrices. Should I multiple them? That didn't make any usefully output.
I hope someone can help with this maybe too specific question, I'm really despaired to make this work and i've spend too many hours of trial & error...
Cheers,
Julian

By ilovegames
Your home planet was attacked. Now you have to use your spaceship to battle the invaders. Powerful 3D arcade with outer space background. Very addictive. Good luck!
Download https://falcoware.com/StarFighter.php



Popular Now