Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1396112 Posts in 67341 Topics- by 60479 Members - Latest Member: Indigo

October 24, 2021, 01:44:53 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The happy programmer room
Pages: 1 ... 276 277 [278] 279
Print
Author Topic: The happy programmer room  (Read 587129 times)
Daid
Level 3
***



View Profile
« Reply #5540 on: November 20, 2019, 12:56:04 AM »

Not posting as image link, as this is a 70MB gif:
http://daid.eu/dump/record_193304_19112019.gif

But really happy with this result. It's dynamic voxel based terrain rendering. Right now this shows a single perlin noise. But I want to use this to build planets/asteroids of all kinds of shapes. Rendering and generation are very unoptimized. But it uses a dynamic octree to switch level of detail when you get closer/furter from different parts.
The cubes will be smoothed at some point.

I have been toying with large planet generation for a long time. And before I tried to do a sphere with heightmap, but never got the results I wanted.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #5541 on: November 20, 2019, 11:32:06 PM »

Very cool technology-wise, but unbearable to look at :-) The black'n'white voxels are probably painted like this for debugging purposes?
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
Daid
Level 3
***



View Profile
« Reply #5542 on: November 21, 2019, 12:22:33 AM »

Very cool technology-wise, but unbearable to look at :-) The black'n'white voxels are probably painted like this for debugging purposes?
Yes. Those are just debug cubes. Eventually they will be properly smoothed, textured and shaded. The only reason I used the cube rendering is because I had some code for that laying around. So I didn't have to write custom mesh generation code yet, and could focus on the dynamic octree generation.
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #5543 on: November 26, 2019, 08:07:49 AM »

I needed a quick project to work on so I made a quick greeble implementation.



On the left a sphere with greeble, on the right a cube with greeble, at the lower center the greeble prefab that is being instantiated on every polygon. So for this first step all that it's doing is instantiating that model on every polygon with random height. I intend on having a pool of greeble pieces to choose from randomly. This is the simplest way to do this.

The challenge, for me, was to come up with a way to deform the greeble piece to fit the base polygon. It turned out ok. I used barycentric coordinates of the two triangles forming each quad, so the deformation is pretty wonky but for greeble it's perfect.

I'm quite happy with this! :D
Logged

Prinsessa
Level 10
*****



View Profile
« Reply #5544 on: November 26, 2019, 08:08:49 AM »

Nice!
Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #5545 on: November 26, 2019, 09:22:44 AM »

Thanks :D Now I added 25 different basic greeble parts to choose from. Project successfully started and finished. I am not entirely sure whether this was time well spent yet lol. It was fun, and that matters.

A knot model all greebled up:


I am impressed with current computers' capacity to push triangles. Once everything is instantiated it renders at more than 100 fps, the same fps of an empty scene! Poly count really isn't a useful parameter these days. I imagine using a complex shader on all of these triangles would change the situation though.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5546 on: November 27, 2019, 08:29:40 AM »

 Hand Any Key define current computer! is it intel gpu? is it geforce 705 ? Radeon R2? Mobile gpu like mali 400 mp not even 2?  Concerned

:cryingpu:  Cry Cry Cry Cry Cry
Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #5547 on: November 28, 2019, 06:04:53 AM »

Hand Any Key define current computer! is it intel gpu? is it geforce 705 ? Radeon R2? Mobile gpu like mali 400 mp not even 2?  Concerned

:cryingpu:  Cry Cry Cry Cry Cry


Ah yes, it is a decent gaming gpu. A Geforce 9xxx.
Anyway, I thought the startup of this greeble was taking too long because it was instancing a thousand objects but, it turns out, it was my incredibly inefficient MapQuads() function that goes through all triangles of the mesh pairing neighbors to define quads. I tried with a slightly bigger model and it took well over 20 minutes to complete the task. Without using quads the whole system crumbles, so I guess this isn't a very useful greeble system.

Very cool seeing people working on their own custom engines in this topic. Way too many awesome projects here to mention.

I actually started creating my own engine a few weeks back, using no external libraries other than the MIcrosoft SDK. I am taking a very modular approach and it is starting to come together nicely.

Will post screenshots when I have something worth looking at.

I agree! After years using Unity and complaining about it I started looking for replacements like Godot. But seeing Princessa's engine rise from the ground up is amazing! I am seriously considering giving that a shot. I tried that when I was a teenager and Unity was still a long time from existing, a million years ago, and gave up because I was not experienced enough. Maybe I could pull it off now.
Logged

Daid
Level 3
***



View Profile
« Reply #5548 on: November 28, 2019, 07:32:08 AM »

Anyway, I thought the startup of this greeble was taking too long because it was instancing a thousand objects but, it turns out, it was my incredibly inefficient MapQuads() function that goes through all triangles of the mesh pairing neighbors to define quads. I tried with a slightly bigger model and it took well over 20 minutes to complete the task.
Put the vertices in a hashmap and vertex-face relations with that. And you'll have speedy lookup of adjacent faces.
Something like this:
https://github.com/Ultimaker/CuraEngine/blob/master/src/mesh.cpp#L97
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
Prinsessa
Level 10
*****



View Profile
« Reply #5549 on: November 28, 2019, 07:37:27 AM »

It was fun, and that matters.

Yes!!

A knot model all greebled up:

Kiss

Very cool seeing people working on their own custom engines in this topic. Way too many awesome projects here to mention.

I actually started creating my own engine a few weeks back, using no external libraries other than the MIcrosoft SDK. I am taking a very modular approach and it is starting to come together nicely.

Will post screenshots when I have something worth looking at.

I agree! After years using Unity and complaining about it I started looking for replacements like Godot. But seeing Princessa's engine rise from the ground up is amazing! I am seriously considering giving that a shot. I tried that when I was a teenager and Unity was still a long time from existing, a million years ago, and gave up because I was not experienced enough. Maybe I could pull it off now.

Thanks, you two! It's a lot of fun, but definitely a huge time sink. People are usually right when they say "make games, not engines". But I'm finally there!! I just can't stop myself from engine work because I enjoy it too much.
Logged

diegzumillo
Level 10
*****


This avatar is so old I still have a some hair


View Profile WWW
« Reply #5550 on: November 28, 2019, 09:50:39 AM »

Anyway, I thought the startup of this greeble was taking too long because it was instancing a thousand objects but, it turns out, it was my incredibly inefficient MapQuads() function that goes through all triangles of the mesh pairing neighbors to define quads. I tried with a slightly bigger model and it took well over 20 minutes to complete the task.
Put the vertices in a hashmap and vertex-face relations with that. And you'll have speedy lookup of adjacent faces.
Something like this:
https://github.com/Ultimaker/CuraEngine/blob/master/src/mesh.cpp#L97

I'm not sure what you're suggesting. But my process sounds like it has the same idea. After the table is done everything is fast, it's the generation that takes too long for large meshes.
Logged

Ordnas
Level 8
***



View Profile WWW
« Reply #5551 on: November 29, 2019, 02:02:16 AM »

I also thought that "make games, not engines" phrase was always true, but now having known more developers in my career I think that depends on the person  Smiley
Logged

Devlogs:

LittleTwig
Level 0
**


View Profile
« Reply #5552 on: November 29, 2019, 03:53:31 AM »

Well, the phrase "make games, not engines" is being misquoted all the time. It originated from https://geometrian.com/programming/tutorials/write-games-not-engines/ , but people just remember the title and not the content. It just says that you should make games alongside your engine, not instead.
Logged
Prinsessa
Level 10
*****



View Profile
« Reply #5553 on: November 29, 2019, 04:26:09 AM »

That's definitely how I prefer to do it at least. Gomez I did start on the engine some time before the game this time but that was after learning from my last project that multi-platform cross-compiling is a PAIN and I wanted to solve it as early as possible and not have to spend weeks figuring out how to port stuff later. Now I've got a nice automagic toolchain that only needs small periodic updates as the engine grows!
« Last Edit: November 29, 2019, 04:35:46 AM by Prinsessa » Logged

InfiniteGamesDS
Level 0
**


It's mee!


View Profile WWW
« Reply #5554 on: December 06, 2019, 11:55:40 AM »


I made procedural colorful balls for my procedural playground horror game.. I love colors and 2.5D Lol   Gentleman



Wish you a good day!  Beer!
Logged

Schrompf
Level 9
****

C++ professional, game dev sparetime


View Profile WWW
« Reply #5555 on: May 25, 2020, 10:20:55 PM »

As a side project I maintain a small tool at work which crawls through gigabyte-sized XML files and extracts snippets from it. Have been using mmap() to load and std::string_view::find() to index it. Then some day I stepped into find() and noticed the implementation is awfully generic and simple. I expected way more from it, to be honest. So I went out to look if I can improve it.

Turns out it is possible. My test dataset was 17GB in size, std::string_view::find() crawled it in 22s which corresponds to 800MB/s. Simple replacement of find(char) with memchr() and find(string) with a small loop of "find first char, memcmp()" already improved that to 12s. My custom bitfiddling 8bytes-at-once memchr() needed 9s. SSE2 intrinsics memchr() 7s. SSE4.2 intrinsics strstr() finally brought it down to 3s. Three seconds vs. standardlib 22s. Now I'm concerned about the quality of the standardlib.

Took me about 5h of accumulated work over the coure of two weeks, and I learned a lot. I'm satisfied. Overall I give Intrinsics 4 out of 5 stars. They're great, but the only good documentation on it (Intel is broken since one week ago.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
nigeynige
Level 0
*


View Profile WWW
« Reply #5556 on: July 19, 2020, 08:48:11 AM »

Having fun with Unity's world-space canvases:

Logged
muki
Level 2
**



View Profile
« Reply #5557 on: October 12, 2020, 12:46:44 PM »

added an in-game UI for my GMS2 project. game has different areas with different ambiences, so I needed a way to play around with graphical variables in-game to really nail them down.

I also want to add non-graphical variables, like player upgrades, AI stuff, etc. and separators!



Logged
marcAKAmarc
Level 0
**



View Profile WWW
« Reply #5558 on: October 23, 2020, 04:01:40 PM »

Just picked up an old project, easily found my way around and added a small feature in one sitting.
Logged

ThemsAllTook
Global Moderator
Level 10
******



View Profile WWW
« Reply #5559 on: October 31, 2020, 06:29:35 PM »

I've been writing some very satisfying graphics code. I had a situation where an object with floating point coordinates was moving diagonally and being rasterized at a low pixel resolution. This can look pretty bad if the two coordinate values are rounded to integers at different times.


(the above gif might not display because my web server needs some attention right now; here's a direct link)

I had been aware of this as a potential problem, but I've never actually implemented a solution to it before. I came up with a function that copies the fractional portion of one coordinate to the other, so that they cross rounding thresholds at the same time and look like this instead:


(temporary direct link to gif)

Much better! Here's the code in case anyone is curious or might have a use for it:

Code:
#include <math.h>

// ioX and ioY are treated as two coordinate values moving together in the direction specified by directionX
// and directionY. For diagonal movement to look nice, every rounding threshold for x should be crossed at
// the same time as it's crossed by y. This function copies the fractional part of one to the other in such
// a way that at thresholds of a size specified by unitSize, both will be rounded to a new integer at the
// same time. Preference is given to copy the fraction of whichever value would not decrease the value of
// its counterpart in the specified direction.
// The magnitude of directionX and directionY doesn't matter; they're only checked for sign and slope.
void matchDiagonalFractionf(float * ioX, float * ioY, float directionX, float directionY, float unitSize) {
  if (directionX != 0.0f && directionY != 0.0f && unitSize > 0.0f && fabsf(directionX) - fabsf(directionY) < 0.00001f) {
    float x = *ioX / unitSize, y = *ioY / unitSize, fractionX, directionalFractionX, fractionY, directionalFractionY, integer;
   
    fractionX = directionalFractionX = fabsf(modff(x, &integer));
    fractionY = directionalFractionY = fabsf(modff(y, &integer));
   
    if (directionX < 0.0f) {
      directionalFractionX = 1.0f - directionalFractionX;
    }
    if (directionY < 0.0f) {
      directionalFractionY = 1.0f - directionalFractionY;
    }
   
    if (directionalFractionX < directionalFractionY) {
      if ((directionX > 0.0f) != (directionY > 0.0f)) {
        fractionY = 1.0f - fractionY;
      }
      x = floorf(x) + fractionY;
    } else {
      if ((directionX > 0.0f) != (directionY > 0.0f)) {
        fractionX = 1.0f - fractionX;
      }
      y = floorf(y) + fractionX;
    }
   
    *ioX = x * unitSize;
    *ioY = y * unitSize;
  }
}
« Last Edit: November 18, 2020, 06:59:54 AM by ThemsAllTook » Logged

Pages: 1 ... 276 277 [278] 279
Print
Jump to:  

Theme orange-lt created by panic