Different-Colored Light-Rays

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Different-Colored Light-Rays

by Inocudom » Sun Mar 17, 2013 20:47

Looking at the lighting given off by various sources in Minetest, I find it sad that the light-rays are all the same color, except for the outdoors ambient lighting at nighttime. I feel that if light-rays were able to be of different colors, the look of Minetest would improve considerably. The coloring could either be done by means of hexadecimal digits, or by using the three number fields that consist of red, green, and blue. Surely, this is not an impossible feat. Surely, this can be done.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Mar 17, 2013 21:01

Currently the lighting is calculated by the CPU by storing an u8 for each corner of each node.
Adding extra variables for red, green and blue light would increase the CPU load a lot.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sun Mar 17, 2013 21:20

PilzAdam wrote:Currently the lighting is calculated by the CPU by storing an u8 for each corner of each node.
Adding extra variables for red, green and blue light would increase the CPU load a lot.


Didn't kwolekr just make lighting updates "21 times faster"? If three colors would have to be computed, then lighting would still be 7 times faster than before the optimisation.

It'd be a great addition and this would be an additional feature over Minecraft (it now supports "HD" texture packs without a patcher, we need a new feature Minecraft doesn't have!).

edit: kwolekr optimized lighting, not PilzAdam.
Last edited by Calinou on Sun Mar 17, 2013 21:52, edited 1 time in total.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Sun Mar 17, 2013 21:39

Calinou wrote:Didn't you just make lighting updates "21 times faster"?

No, it was hmmmm (aka kwolekr).
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sun Mar 17, 2013 22:37

If a computer has a graphics card, shouldn't the card be the sole generator of graphics and not the CPU? Lighting is part of the graphics area, so a graphics card should boost that too (mine is a GeForce Gt 610 with 2GB of memory.)
Last edited by Inocudom on Sun Mar 17, 2013 22:39, edited 1 time in total.
 

rarkenin
Member
 
Posts: 668
Joined: Tue Nov 20, 2012 20:48

by rarkenin » Sun Mar 17, 2013 23:09

Inocudom wrote:If a computer has a graphics card, shouldn't the card be the sole generator of graphics and not the CPU? Lighting is part of the graphics area, so a graphics card should boost that too (mine is a GeForce Gt 610 with 2GB of memory.)


No, since it is computed, stored, and transferred CPU-side.
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Mon Mar 18, 2013 01:23

A little more background info: the GPU by itself does not compute shadows due to occlusion of light sources by other surfaces (or, at least, any GLSL you used to try to compute such shadows would be extremely slow or limited in effectiveness). The only intelligence a shader typically has as far as "shadows" are concerned is that it doesn't use a particular light to illuminate any surface pointing AWAY from the light, so the "back" of an object will be illuminated differently from its "front". So typically the CPU figures out exactly what light sources can affect any particular primitives it is going to draw, and the GPU just takes care of the curvature and shape of the primitive.

What we have in Minetest is a pretty complex situation in terms of lighting. Many games have relatively static areas where it is pretty well known what light sources will affect what objects in different regions. The dynamic nature of the maps in Minetest does away with that simplicity, but fortunately its use of regular and constantly shaped voxels still allows lighting the environment to be feasible without making things look terrible or dragging performance into the mud.
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Mon Mar 18, 2013 01:30

I wish to show you a video of how beautiful light-rays with different colors can be. I found this video on Youtube and it depicts a custom Half Life map.
http://www.youtube.com/watch?feature=player_detailpage&v=j-cfrXLLzeo

This could start out as a mod for the sake of testing, learning, and improvement. Such a mod was made for Minecraft, and that game is slower and uses Java. If it can be done in that game, it should be possible in Minetest too. Again, the creation of a test mod is the first step.
Last edited by Inocudom on Mon Mar 18, 2013 01:35, edited 1 time in total.
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Mon Mar 18, 2013 02:09

PilzAdam wrote:Currently the lighting is calculated by the CPU by storing an u8 for each corner of each node.
Adding extra variables for red, green and blue light would increase the CPU load a lot.

Could we instead use a single extra u8 for the whole node, and just store an average or total hue and saturation, using 4 bits each? That could provide enough extra detail to dramatically improve quality, with little enough extra requirement for storage or computation to perhaps be a good tradeoff....
Last edited by prestidigitator on Mon Mar 18, 2013 02:09, edited 1 time in total.
 

jin_xi
Member
 
Posts: 165
Joined: Mon Jul 02, 2012 18:19

by jin_xi » Mon Mar 18, 2013 09:09

JacobF made this topic a long time ago: http://forum.minetest.net/viewtopic.php?id=1262
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Mon Mar 18, 2013 14:46

jin_xi wrote:JacobF made this topic a long time ago: http://forum.minetest.net/viewtopic.php?id=1262


I saw that topic and its video, and it proves with absolute certainty that Minetest can be capable of colored light-rays. The version the test mod was done in hails from the 0.3.1 days. With all of the lighting and engine improvements Minetest has had lately, there is no excuse now. Colored light-rays are no longer in the realm of fantasy and impossibility.

Why did JacobF discontinue the experimental mod and where is he now?
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Fri Mar 22, 2013 16:50

Has anyone attempted this as of late? Colored lighting is not a bad thing, but a good thing.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 9 guests

cron