Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 06:36:03 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)General thread for quick questions
Pages: 1 ... 57 58 [59] 60 61 ... 69
Print
Author Topic: General thread for quick questions  (Read 134437 times)
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #1160 on: October 14, 2017, 09:31:23 AM »

Perfect, thanks!
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1161 on: October 14, 2017, 05:07:16 PM »

The quick not exactly accurate version is that tangent is simply the direction of the UV map, ie the direction of the surface (useful for anisotropic effects), with the binormal (which you can always reconstruct by a cross product of the vector and binormal) they form an orthonormal basis to the vertex or fragment you can use to do whatever. And if you don't use it, you can still use the slot for passing random data Tongue
Logged

ferreiradaselva
Level 3
***



View Profile
« Reply #1162 on: December 03, 2017, 04:52:59 PM »

Any way to 100% remove bleeding edge problem in OpenGL (that doesn't include adding a 1px transparent border in every sprite)? I'm already using nearest neighbor, since it's for the aesthetics of my game, but the problem still happens (rarelly).
Logged

qMopey
Level 6
*


View Profile WWW
« Reply #1163 on: December 03, 2017, 05:51:12 PM »

Solution is sitting in my code on github in 2 different locations; squeeze your UV coordinates inward (disregarding mipmaps) by some tuning factor. Padding pixels is a *very* bad solution.
Logged
ferreiradaselva
Level 3
***



View Profile
« Reply #1164 on: December 03, 2017, 07:13:54 PM »

I was thinking about doing that, but (apparently) I found the solution! It seems that the problem was that my texture wasn't power of 2 :D No more texture bleeding when I changed the size to power of 2
Logged

qMopey
Level 6
*


View Profile WWW
« Reply #1165 on: December 03, 2017, 09:41:31 PM »

Be sure to test with rotated + scaled sprites, and look for flickering bleeding along the edges. It's easiest to spot them if the background atlas color is white, while the background of the window is black. Also pixel shader float precision might affect results? Not really sure here, but I'd be weary of at least doing some testing.
Logged
powly
Level 4
****



View Profile WWW
« Reply #1166 on: December 04, 2017, 05:47:02 AM »

The quick not exactly accurate version is that tangent is simply the direction of the UV map, ie the direction of the surface (useful for anisotropic effects), with the binormal (which you can always reconstruct by a cross product of the vector and binormal) they form an orthonormal basis to the vertex or fragment you can use to do whatever. And if you don't use it, you can still use the slot for passing random data Tongue

Bitangent, not binormal — it’s a second tangential direction. It’s also not orthonormal in general, and baking them to vertices is usually a bad idea since it’s really a property of the triangles instead (think of a place where the texture changes; the tangent will be constant over each triangle but jumps at the edge). Just compute it in the geometry shader or equivalent.
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1167 on: December 04, 2017, 08:19:03 AM »

I said yoi can compute the binormal with the binormal, obvious mistake lol, I will just say unity store the tangent per vertex, I heard that's standard (it's linearly interpolated anyway, normal too so you need to correct normal in fragment generally).
Logged

eyeliner
Level 10
*****


I'm afraid of americans...


View Profile
« Reply #1168 on: December 06, 2017, 04:04:43 AM »

HUD, overlays, borders, sufaces?
Logged

Yeah.
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1169 on: December 06, 2017, 12:56:41 PM »

How do you handle pause in time sensitive game with variable delta time ?
I mean when I pause the game the delta time get bigger, i'm pretty sure it's simple but I'm mentally block lol, I'm sure asking here and I will figure out 2s later
Logged

ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #1170 on: December 06, 2017, 01:37:15 PM »

Store the current time when you pause, measure the difference when you unpause, then subtract that from the next delta or something equivalent.
Logged

LittleTwig
Level 0
**


View Profile
« Reply #1171 on: December 06, 2017, 02:22:28 PM »

You can just scale the deltaTime and let your update run during pause. When you pause you set the dt scale to 0. For stuff that should be animated during pause you can expose something like unscaledDeltaTime. It also makes stuff like slowmo really easy.
Logged
Garthy
Level 9
****


Quack, verily


View Profile WWW
« Reply #1172 on: December 06, 2017, 09:21:32 PM »

Use two clocks. One clock advances when paused, one does not.
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1173 on: December 07, 2017, 12:45:08 AM »

Definitely two clocks. Maybe even more. I usually got around five or something - the engine has one for shader effects, the game logic has one for general game progress, the GUI has one for timing animations, there's a global clock for logging and so on.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Garthy
Level 9
****


Quack, verily


View Profile WWW
« Reply #1174 on: December 07, 2017, 12:56:13 AM »


Definitely two clocks. Maybe even more. I usually got around five or something - the engine has one for shader effects, the game logic has one for general game progress, the GUI has one for timing animations, there's a global clock for logging and so on.

That's awesome!

The two I always end up with are the game/engine clock (handles game and animation, pausable) and the real clock (handles GUI/user etc, never stops). The logical extension to this setup is an arbitrary set of clocks. I've not had a need for more than two, but wondered if one day I would. I also wondered if others did something similar, and if anyone ever had a need for several.

Do you ever scale them? Independently? I found it useful to have scaling when performing testing. For example, watching graphical transitions at 1/100 speed helps find problems that are normally too fast to see, and running 100x speed lets you perform some sorts of automatic testing in a reasonable real-world timeframe.
Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1175 on: December 07, 2017, 01:05:49 AM »

Never thought about scaling for debug purposes, to be honest. I scale the Game Logic timer for slow motion and for smooth transitions from/to the Pause menu. Scaling it *up* would be an interesting idea, except that upto now I always used flexible time steps, and those can only grow so much until something breaks in the game logic.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Garthy
Level 9
****


Quack, verily


View Profile WWW
« Reply #1176 on: December 07, 2017, 03:01:32 AM »

 
I scale the Game Logic timer for slow motion and for smooth transitions from/to the Pause menu.

Re from/to pause, that's a neat idea. I've never tried that. Pause/resume has always been sudden stop/start in the things I've created. Are you literally ramping the speed up once you resume from pause, and down to pause; or something else? How does it feel as a player compared to a sudden stop/start?

As for slow-mo, I've had ideas that could use the mechanic, but it has not been in anything I've created thus far. I bet it'd be a lot of fun to work with as a game mechanic.


Logged
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1177 on: December 07, 2017, 03:40:56 AM »

Re from/to pause, that's a neat idea. I've never tried that. Pause/resume has always been sudden stop/start in the things I've created. Are you literally ramping the speed up once you resume from pause, and down to pause; or something else? How does it feel as a player compared to a sudden stop/start?

Check the game in my signature, the current Steam distributor sells it for a laughable price. I personally think it works well, but I might be biased. I put a lot of effort into weird requirements, like being able to save/load in *any* situation - admidst a fire fight, in cutscenes, even while being in a cutscene demanding a decision.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1178 on: December 07, 2017, 09:14:11 AM »

Two clock don't solve the problem since you still need a master clock to initialize the others, and they are dependent on the potentially variable delta.
Code:
dt = t_current - t_old //get the delta time
t_old = t_current      //set the time from next frame delta

effect = action.magnitude * dt;

Onpause:
//freeze current frame, old time is obsolete

Onresume:
//we need a valid dt between, init an arbitrary dt?


Also I'm having issue with precision falling like a rock due floating point, it's very visible lol. Especially when computing time of day, I also loss precision due to regularly incrementing low frequency clock (hour, second, day)  that cause a slow drift of sync
« Last Edit: December 07, 2017, 09:27:43 AM by gimymblert » Logged

qMopey
Level 6
*


View Profile WWW
« Reply #1179 on: December 07, 2017, 11:17:11 AM »

You can only have one source of floating point incrementation. All other copies need to be set or offset from the source repeatedly. This establishes consistency.
Logged
Pages: 1 ... 57 58 [59] 60 61 ... 69
Print
Jump to:  

Theme orange-lt created by panic