Black-and-white Minetest/video games

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

Black-and-white Minetest/video games

by ABJ » Tue Aug 09, 2016 14:55

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: 272
Joined: Sat Jul 19, 2014 11:52
Location: Serbia, Užice
GitHub: lisacvuk
IRC: lisac
In-game: lisacvuk

Re: Black-and-white Minetest/video games

by lisacvuk » Wed Aug 10, 2016 06:55

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: 5340
Joined: Wed Jul 08, 2015 13:20

Re: Black-and-white Minetest/video games

by MineYoshi » Wed Aug 10, 2016 21:07

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!
adieu aze. :-(
 

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

Re: Black-and-white Minetest/video games

by ABJ » Thu Aug 11, 2016 06:41

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: 5340
Joined: Wed Jul 08, 2015 13:20

Re: Black-and-white Minetest/video games

by MineYoshi » Thu Aug 11, 2016 22:05

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!
adieu aze. :-(
 

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

Re: Black-and-white Minetest/video games

by Ferk » Thu Aug 11, 2016 22:19

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: 5340
Joined: Wed Jul 08, 2015 13:20

Re: Black-and-white Minetest/video games

by MineYoshi » Thu Aug 11, 2016 22:49

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...
adieu aze. :-(
 

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

Re: Black-and-white Minetest/video games

by ABJ » Fri Aug 12, 2016 08:01

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: 5340
Joined: Wed Jul 08, 2015 13:20

Re: Black-and-white Minetest/video games

by MineYoshi » Fri Aug 12, 2016 22:15

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!
adieu aze. :-(
 

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

Re: Black-and-white Minetest/video games

by cd2 » Sat Aug 20, 2016 11:09

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
(428.22 KiB) Not downloaded yet
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
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 

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

Re: Black-and-white Minetest/video games

by cd2 » Sat Aug 20, 2016 11:22

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
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 

User avatar
azekill_DIABLO
Member
 
Posts: 7381
Joined: Wed Oct 29, 2014 20:05
Location: Under my desk (but I can't see my monitor now X'[ )
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Black-and-white Minetest/video games

by azekill_DIABLO » Sat Aug 20, 2016 11:33

yep. i think shaders should be applying to all elements in game.
【OMICRON】 ; 【MILA】 update ; 【Rec_a_MT】 ; 【BB,HD】 update ; 【▶ Youtube】 This person worked too hard to be forgotten: Feedback me!
 

User avatar
Hybrid Dog
Member
 
Posts: 2613
Joined: Thu Nov 01, 2012 12:46

by Hybrid Dog » Sat Aug 20, 2016 11:55

Try this:
col.rgb = vec3(max(col.rgb.r, max(col.rgb.g, col.rgb.b)));
Image
Attachments
screenshot_20160820_135320.png
(481.16 KiB) Not downloaded yet
 

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

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

Re: Black-and-white Minetest/video games

by cd2 » Sun Aug 21, 2016 07:38

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
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 

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

Re: Black-and-white Minetest/video games

by cd2 » Sun Aug 21, 2016 09:47

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
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.
GitHub: ABJ-MV
In-game: ABJ
 

User avatar
BBmine
Member
 
Posts: 3408
Joined: Sun Jul 12, 2015 22:51
Location: USA
IRC: BBmine
In-game: Baggins
 


Return to Partly official engine development



Who is online

Users browsing this forum: No registered users and 2 guests