« first day (3592 days earlier)      last day (1418 days later) » 

2:15 AM
The missing piece (for games up to about this point at least, I'll elide raytracing for now) is rasterization
For every triangle you send to your GPU, the vertex shader transforms each of its vertices into points on your screen.
Then the rasterizer finds all the pixels covered by the triangle those points form,
for each pixel, the interpolator blends an intermediate mix of the texture coordinates and other properties from the three corner vertices,
and then the pixel/fragment shader runs for each of these pixels, with the interpolated vertex properties as its arguments.
Your lighting calculations can happen as part of the vertex shader, so the colours are just interpolated across the surface of the triangle. Older games did this to save on the computation cost of lighting.
But much more frequently in modern games, the lighting is done in the pixel/fragment shader, for each pixel drawn to the screen. That means you can get sharp highlights much smaller than a triangle.
So, you have the vertex shader that transforms the vertices of a triangle to the screen, the rasterizer that picks out the pixels that triangle covers, and the pixel shader that outputs the colour to blend into the frame buffer for each pixel.
 
 
8 hours later…
10:14 AM
Hello! What should one do before publishing a game on itchio? I know i can upload it just right now but just wondering
 
 
2 hours later…
12:07 PM
@DMGregory Thanks a lot ! That was the missing information... our prof didnt even mentioned this... :D
 
@genaray It's not univeral. If you're doing raytracing, all the lighting calculations follow the same principles, but the logic for how those colours get mapped to your screen is different. So your prof's probably trying to teach you about lighting in general, not just the rasterization flow.
@0x00004 What specific outcome do you want, that's not served adequately by uploading the game right now?
 
Another problem... lets say we want to rotate Object A around the middle point of Object B... the problem here is that Object B changes it position constantly... how could we do this ? My current moon rotates around my planets x axis... but does not change its x position :/ So if my planet moves, the moon stays at its place and rotates around the x axis without moving along the planet
 
user92578
You need a transform hierarchy
 
@Tyyppi_77 Hmmm... Is this the only way ? ^^ What if i want to rotate a entity around the other when both of them are in different hierarchies ?
 
user92578
12:24 PM
There's no way to magically make an object respect another object's transform without considering the other object's transform
 
12:39 PM
Hmmm thats right :o
 
user92578
I think it might be possible of you moved away from transforms and instead simulated everything with forces
 
12:55 PM
I'd agree a transform hierarchy is probably the simplest way to do this, and likely what your assignment is designed to teach you in this case.
You can also store a reference to your primary/follow target, and an offset vector from it. Each frame you rotate your offset vector, keeping it in the correct plane / at the correct length, then add it to your primary's position to get your net position. Camera follow scripts often do this.
The trick is that for frame-perfect accuracy, you need to make sure the moon/follower's position update happens after the primary/leader's. Otherwise you can position yourself perfectly for the previous frame, then your leader moves ahead by another frame step, leaving you slightly behind where you should be for the frame.
(For cameras, this can make the main character appear to jerk around or vibrate on the screen)
 
1:09 PM
@DMGregory Thanks ! We are currently implementing the hierarchie :) The only problem we have are the references... we basically have a anchor which should have a reference towards a position... using "ENTT" ecs this reference persists but the values are getting set to zero at some point...
 
@DMGregory Thanks, my current approach is to realize this kind of behaviour with pointers... struct Anchor{ Position *pos; } pos is a pointer towards the Position struct of another entity... looks like it dont really work...
 
If you're using ENTT, taking a pointer to a specific struct might not be safe, particularly if you try to hold that pointer between frames. The framework might have to move components around at some point, leaving your pointer pointing at the wrong thing.
 
 
3 hours later…
4:32 PM
1
Q: How can I create a persistent seed for each chunk of an infinite procedural world?

FeatherballI'm coding a chunk-based 2D game. I generate chunks as the player explores the world. Chunks follow a procedural generation algorithm (with only one biome implemented at the minute, but I'll introduce more). When the player leaves a chunk however and it's unloaded, that chunk is lost for good (...

 

« first day (3592 days earlier)      last day (1418 days later) »