Black-and-white Minetest/video games

For people working on the C++ code.
Post Reply
ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Black-and-white Minetest/video games

by ABJ » Post

Okay. I know this is a strange idea, and I may not even properly know what I'm trying to talk about, but what if Minetest, or other video games, used graphics engines (wait, am I correct?) that only rendered black and white, where all we need is a base texture and how dark it is, instead of all this RGB stuff? How much would performance be improved? Could such a thing be done?
Again, note, I'm just a curious newbie.

User avatar
lisacvuk
Member
Posts: 274
Joined: Sat Jul 19, 2014 11:52
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk
Location: Serbia, Užice

Re: Black-and-white Minetest/video games

by lisacvuk » Post

You'd probably only save memory, I think. Performance probably wouldn't be really improved, at least not noticeably. I'm not expert (or even over the basics level) in this field, so feel free to correct me, if I'm wrong (or actually not wrong).
It's lisac, not lisa.
400 character limit? Am I writing a book?
Administrator on Craig's server. Minetest player.
"The enemy pales when they see the face of Dazzle!" ~ Dazzle obviously.
I live in Serbia.
Steam | OpenDOTA
My mods:
Tool ranks
I appreciate donations in TF2 items. :)

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Black-and-white Minetest/video games

by MineYoshi » Post

lisacvuk wrote:You'd probably only save memory, I think. Performance probably wouldn't be really improved, at least not noticeably. I'm not expert (or even over the basics level) in this field, so feel free to correct me, if I'm wrong (or actually not wrong).
May be...

In my opinion you can get a bit more of performance, in Black and White...
If you modify the code to make that particles, only be of one color...

Can be a good idea do that...
Try it!
Have a nice day! :D

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

Yeah.
I was thinking that now we have to deal with four values (RGBA) but then we'd need only one?

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Black-and-white Minetest/video games

by MineYoshi » Post

ABJ wrote:Yeah.
I was thinking that now we have to deal with four values (RGBA) but then we'd need only one?
Actually Black Is the absence of the colors, the black is the presence (Totally) of every one...
RGBA means RedGreenBlueAlpha...
If you think about some textures can have "alpha" or transparency, you don't going to only handle one value!
Have a nice day! :D

User avatar
Ferk
Member
Posts: 337
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: Black-and-white Minetest/video games

by Ferk » Post

This makes no difference in current hardware. Even if you use some sort of grayscale in your textures, at some point it'd end up translated into some internal representation that separates it in color channels that mix to give whatever shade of gray (that's how the screens work anyway).

I doubt you'd even save memory unless you use some archaic format to store the image data in memory. And even then it won't make it any faster.. perhaps slower depending how awkward the format is to deal with.

If you want faster image loading better just don't use any sort of image compression (unless you have a slow hard disk). The image will be larger on disk but it will load faster on memory. But even then you probably won't notice much of a difference anyway.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Black-and-white Minetest/video games

by MineYoshi » Post

Ferk wrote:This makes no difference in current hardware. Even if you use some sort of grayscale in your textures, at some point it'd end up translated into some internal representation that separates it in color channels that mix to give whatever shade of gray (that's how the screens work anyway).

I doubt you'd even save memory unless you use some archaic format to store the image data in memory. And even then it won't make it any faster.. perhaps slower depending how awkward the format is to deal with.

If you want faster image loading better just don't use any sort of image compression (unless you have a slow hard disk). The image will be larger on disk but it will load faster on memory. But even then you probably won't notice much of a difference anyway.
But actually can be good for trying to test out how is Minetest when it got to convert RGBA textures to Black/White ones...
Have a nice day! :D

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

OK.
In any case, we can just have one texture and set how dark it is (eg; pinewood, wood, junglewood, acaciawood, etc) with the same texture and a little coding.

Either way, IMHO all those World War simulators should become black-and-white.
Last edited by ABJ on Sat Aug 13, 2016 06:45, edited 1 time in total.

User avatar
MineYoshi
Member
Posts: 5373
Joined: Wed Jul 08, 2015 13:20
Contact:

Re: Black-and-white Minetest/video games

by MineYoshi » Post

ABJ wrote:OK.
In any case, we can just have one texture and set how dark it is (eg; pinewood, wood, junglewood, acaciawood, etc) with the same texture and a little coding.
Maybe...
If you change the palete to only 4 greys, i don't know. the game can be faster, starting from the point that when a texture is less bigger, and less colorful... It's faster to load!
Have a nice day! :D

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Black-and-white Minetest/video games

by cd2 » Post

To see how it could look, just add this line of code to the end of opengl_fragmet.glsl (for me its line 212):

Code: Select all

col = vec4((col.b+col.g+col.b)/3.0,(col.b+col.g+col.b)/3.0,(col.b+col.g+col.b)/3.0, col.a);
Image
Attachments
screenshot_20160820_131308.png
screenshot_20160820_131308.png (428.22 KiB) Viewed 1186 times
Last edited by cd2 on Sat Aug 20, 2016 11:23, edited 2 times in total.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

Thanks and where is it?
BTW what about the sky though.

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Black-and-white Minetest/video games

by cd2 » Post

ABJ wrote:Thanks and where is it?
client/shaders/node_shader
ABJ wrote:BTW what about the sky though.
It just changes all nodes, but I think you cant change the sky color via a shader is it?

PS : This wont improve performance

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

I knw but it looks cool.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: Black-and-white Minetest/video games

by azekill_DIABLO » Post

yep. i think shaders should be applying to all elements in game.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Hybrid Dog
Member
Posts: 2834
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

by Hybrid Dog » Post

Try this:
col.rgb = vec3(max(col.rgb.r, max(col.rgb.g, col.rgb.b)));
Image
Attachments
screenshot_20160820_135320.png
screenshot_20160820_135320.png (481.16 KiB) Viewed 1186 times

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

Water=blue
Sky=blue
BTW where to paste anyway?

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Black-and-white Minetest/video games

by cd2 » Post

ABJ wrote:BTW where to paste anyway?
cd2 wrote:(for me its line 212)

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

Ooooooooooooon which file in where.

User avatar
cd2
Member
Posts: 562
Joined: Mon Jun 01, 2015 06:30
GitHub: cdqwertz
In-game: cd cd2
Location: Linux
Contact:

Re: Black-and-white Minetest/video games

by cd2 » Post

cd2 wrote:
ABJ wrote:Thanks and where is it?
client/shaders/node_shader
client/shaders/node_shader/opengl_fragmet.glsl
line : 211/212

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Black-and-white Minetest/video games

by ABJ » Post

Oh sorry I wasn't reading that well enough.

BBmine
Member
Posts: 3476
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: Black-and-white Minetest/video games

by BBmine » Post

Interesting..... I could use a texture pack too :)

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests