Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411281 Posts in 69324 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 11:04:20 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsReturn of the Obra Dinn [Releasing Oct 18]
Pages: 1 ... 27 28 [29] 30 31 ... 44
Print
Author Topic: Return of the Obra Dinn [Releasing Oct 18]  (Read 927592 times)
JobLeonard
Level 10
*****



View Profile
« Reply #560 on: January 16, 2016, 04:17:33 AM »

PSA: Make sure your browser displays these images at proper 100% zoom before judging them (I almost posted a complaint about compression artifacts until I realised it was my browser's zoom function that was to blame)

Koloth, that looks awesome; I especially like the second one. Got a write-up of how the algorithm works somewhere? Maybe publish a small maths paper? :D

I kind of wonder if you could make it shimmer less if the dithering algorithms don't just take the current image as input, but also the previous one? So kind of thinking in terms of incremental updates to the error diffusion, based on differences between the frames?
Logged
Koloth
Level 0
*


View Profile
« Reply #561 on: January 16, 2016, 10:40:42 AM »

No write up yet, but in a couple of days I'll add some comments to my code and put it somewhere so that people can use it.  Unfortunately using the previous frame doesn't help remove the shimmer---in fact it makes it worse!  After each update step, the image is essentially uncorrelated with what it was before the update which makes it a bit tricky...
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #562 on: January 16, 2016, 12:14:34 PM »

That's to be expected. What I meant was coming up with a dithering algorithm from the ground up (yeah, I know: you just did, but from an entirely different starting point).

My thoughts were as follows: suppose there is an algorithm where you have an existing "dithering solution" to the previous frame, and update that solution with the new frame based on the new frame. To "bootstrap" it you could start with a known solution for a black screen (presumably also a black screen) and update from there.

A comparable example would be Adrian Secord's weighted Voronoi stippling, which uses Voronoi relaxation to create an image. Assuming that two frames don't differ too much, a solution to one frame is a good first guess for a solution for the next frame.

Of course, I have no idea how one would make such a dithering algorithm run fast.
Logged
dukope
Level 3
***


View Profile WWW
« Reply #563 on: January 20, 2016, 11:14:53 PM »

Hey all. Been a while but I should be back in the swing of things soon. There's a few posts I want to make but also a pressing deadline that I'll also talk more about soon.


This looks great! I don't know if this will fit in performance and production-wise but I'd love to give it a shot. Will PM for details.
Logged

Koloth
Level 0
*


View Profile
« Reply #564 on: January 23, 2016, 05:04:40 PM »

Hey so I've commented up the code so it should hopefully be kinda readable?  I do all my prototyping in Processing 3: https://processing.org, and this shader is no exception.  The relevant files are available here.

[edit: fix download link]
« Last Edit: February 12, 2016, 11:39:11 AM by Koloth » Logged
JobLeonard
Level 10
*****



View Profile
« Reply #565 on: January 24, 2016, 02:25:06 AM »

P5 FTW! Hand Thumbs Up Left

EDIT: This may be a problem with my setup (Linux) but it can't compile the shader at line 390 and crashes.

Code:
Cannot compile fragment shader:
0(8): error C1105: cannot call a non-function
0(9): error C1105: cannot call a non-function
« Last Edit: January 24, 2016, 02:32:13 AM by JobLeonard » Logged
Koloth
Level 0
*


View Profile
« Reply #566 on: January 24, 2016, 11:00:23 AM »

P5 FTW! Hand Thumbs Up Left

EDIT: This may be a problem with my setup (Linux) but it can't compile the shader at line 390 and crashes.

Code:
Cannot compile fragment shader:
0(8): error C1105: cannot call a non-function
0(9): error C1105: cannot call a non-function


Hmmmm....  The fact my code only goes up to line 382 is going to get in the way of debugging this...  If I were to guess, it might have to do with the fact that the texture uniform is called "texture" and then I access it using the function "texture".  I fear while I've done a lot of coding, I am far from a shader expert so I actually don't know how to modify that as I think processing looks for the texture uniform to bind to when you use it as a filter.
Logged
dukope
Level 3
***


View Profile WWW
« Reply #567 on: January 29, 2016, 06:30:09 PM »

Dithering Revisited

One of the things that's been a problem with this game is how the visual style works against the core mechanic. You need to be able to see and recognize faces, but 640x360 1-bit with dithering is pretty hard luck for showing facial details. This creates a situation where it's easy to question why someone would make such a low resolution black and white game in the first place. Questions are bad so this is something that's bothered me for a while.

To help with this, a few weeks ago I implemented a "zoom" feature when you look at a face. This feels as clunky as it sounds. Recently I decided the crappy zoom wasn't enough and that I needed to increase the game's resolution to 960x540. That's half 1080p and while it still feels like a low resolution, the faces are a lot easier to see. That pretty much settled it until Brent Werness (Koloth) popped in here with a nice gift.

If you go back to my previous post on dithering, you can see that my ideal algorithm would be an error diffuser like Floyd-Steinberg or Atkinson. Error diffusion techniques are all based on random memory access and so unsuited for shaders. What Werness built is a hybrid between noise thresholding and progressive error diffusion. And like lots of CPU->GPU translations, he's turned the algorithm inside out - instead of spreading one pixel's error to its neighbors, each pixel sucks up the error of its neighbors. When done correctly in phases this affects a diffusion of the errors.

Examples

Using the source image in this great article on dithering:


Original companion cube image


Photoshop's 1-bit error diffusion dither at 75% (likely Atkinson)


The game's old pattern dither (blue noise)


Werness's method (2 phases, seeded with blue noise)


Comparing the last two, it's easy to see that Werness's method shows details much more clearly. It blows out the lights and darks like Photoshop does but that's a fair trade in my case. And it's more than just increasing contrast, nearby pixels compensate for error to increase accuracy at edges. Exactly what I need for detailed faces.

With a slightly more illustrative image. This is a sort of worst-case for error diffusion since there are zero details, but it helps to see the ranges:



Gradient


Photoshop's 1-bit error diffusion dither at 75%



The game's old pattern dither (blue noise)


The game's Werness at 75%


The Werness method has pretty poor reproduction at the low and high end of the gradient, so it helps to tweak the values a little more to stretch the available range:


The game's Werness at 90% with a preprocess level adjustment


Still blue noise is a better choice here, which highlights how dependent dithering is on the source material. In any case, Werness's method absolutely kills it for in-game facial details.


In-game Shots

Double-sized pixels to match what you'd normally be playing at.


Some dude


Another dude

Pure wizardry. The important details are captured really well. Where important pixels had to be sacrificed for the pattern dithers, the error diffusion keeps them intact. Many thanks to Brent for sharing his work!
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #568 on: January 29, 2016, 06:34:34 PM »

but what if you alter the gradient ramp too? to control the noise spread using on non linear ramp?

I'm sure you have thought of that so discard this post if true
Logged

dukope
Level 3
***


View Profile WWW
« Reply #569 on: January 29, 2016, 06:39:25 PM »

but what if you alter the gradient ramp too? to control the noise spread using on non linear ramp?

Not sure if I follow exactly, but the preprocess step does a simple brightness/contrast adjustment to better use the middle range. Koloth also suggested blending to blue noise at the dark and light ends of the range but the current result works well enough that I haven't tried that yet.
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #570 on: January 29, 2016, 08:06:02 PM »

I was just saying that the original grayscale ramp does not have to be mathematically correct.

Adjusting the slope and shape of the gradient curve, clamping it or offsetting it manually before transfer for artistic adjustement. Basically some more operation than just brightness and contrast. Manipulating the gradient source before applying the noise. Possibly with slider to adjust in real time until it please the eyes.

For example photoshop don't use linear gradient for their gradient, they use a sort of circular gradient (taper on extremum, bigger in middle) or in photography we use a S-curve on raw histogram data to make it pleasing and or readable. Aesthetics adjustment.
- http://www.photoshopessentials.com/photo-editing/how-to-read-and-understand-image-histograms-in-photoshop/
- http://blog.epicedits.com/2010/02/03/tone-up-your-curves-skills/
- http://blog.epicedits.com/2010/02/12/nonlinear-curve-adjustments-and-histograms/
- http://www.photoshopessentials.com/photo-editing/levels-curves/
- http://davidkunzman.net/photographyArticles/histograms/part5.php
- http://www.fourandsix.com/blog/2011/10/31/truthful-photo-editing-levels-curves-and-the-histogram.html
- http://www.cambridgeincolour.com/tutorials/photoshop-curves.htm

To be frank in AAA game there is dynamic adjustment based on histogram happening all the time now.

Game do that already with full colors (color grading)
http://blogs.unity3d.com/2015/05/12/color-grading-with-unity-and-the-asset-store/
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #571 on: January 29, 2016, 08:09:26 PM »

I went overboard with histogram Huh? oh well it was late
Logged

chegr
Level 0
***


Don't play baseball


View Profile WWW
« Reply #572 on: January 30, 2016, 06:47:57 AM »

Oh, yeah! I've been wating for these pics! I have kept refreshing this tab since Werness posted each time I went to browser, and it came out great!
Logged

Koloth
Level 0
*


View Profile
« Reply #573 on: February 01, 2016, 11:52:25 AM »

Just wanted to pop by and say that it is indeed lovely to see it in game, and it was great working with you to improve the shader even further!  Can't wait to play with it in action!
Logged
JobLeonard
Level 10
*****



View Profile
« Reply #574 on: February 01, 2016, 12:32:00 PM »

Jezus Christ, those faces are amazing!

Yer a wizard, Koloth! Wizard
Logged
plauk
Level 0
**



View Profile WWW
« Reply #575 on: February 04, 2016, 07:03:45 PM »

That's goddamn beautiful.
Logged
benjkers
Level 0
***


digging for precious games


View Profile WWW
« Reply #576 on: February 07, 2016, 07:40:29 AM »

Can't get enough of these visuals. We've been experimenting with dither methods too - though without any of your resolution or colour depth challenges.

I love what Bayer, and pattern-based in general, does for decorative aesthetics - though definitely your ultimate solution is best fit certainly. The character eye/pupils are nice and clear, big win. Hand Thumbs Up Left
Logged

akavel
Level 0
*


View Profile
« Reply #577 on: February 27, 2016, 04:10:46 PM »

Hey so I've commented up the code so it should hopefully be kinda readable?  I do all my prototyping in Processing 3: https://processing.org, and this shader is no exception.  The relevant files are available here.

[edit: fix download link]

For the record: I've taken the liberty of uploading the unzipped contents of this archive on github at: https://github.com/akavel/WernessDithering in case someone's interested in the algorithm in future, in case it disappears from DropBox (spring cleaning or whatever). I've tried to credit it left and right so that it's obvious it's not my authorship. Are you OK with that? Also, could you hopefully provide some licensing info or something? People sometimes need such things. TIA! [I'm not into Processing, so not really sure if I uploaded all the necessary stuff, hope that yes; did it just for archiving's sake]
Logged
dukope
Level 3
***


View Profile WWW
« Reply #578 on: March 09, 2016, 06:59:04 PM »

A quick note that a newer playable build of Return of the Obra Dinn will be in the Day of the Devs area at GDC along with a bunch of other cool games. Stop by and say hi if you're around.




There's a bunch more stuff to post but it'll have to wait a bit. Still frantically trying to get this build together.
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #579 on: March 10, 2016, 02:57:14 AM »

I recall an earlier post where you said you wanted to have a "stable" ditherer for the sky; did I miss the part of the conversation where you abandoned that?

Either way, looks great!
Logged
Pages: 1 ... 27 28 [29] 30 31 ... 44
Print
Jump to:  

Theme orange-lt created by panic