nodebox with/without paramtype="light"

sema4
New member
 
Posts: 4
Joined: Tue Dec 04, 2012 19:06

nodebox with/without paramtype="light"

by sema4 » Mon Dec 10, 2012 06:27

i have been scratching my head on this for a while now, maybe someone can enlighten me....

Why, if i want a node with nodetype="nodebox", is it necessary to use paramtype="light" in order for its texture to be visible? if i omit paramtype="light" the nodebox contents are rendered in black.

(see nodebox panels in the foreground rendered in black, even though texture is white)
[img=nodebox paramtype light omitted]http://rm-rstar.com/~sema4/minetest/screenshot_134610645.png[/img]

using paramtype="light" is problematic since it causes undesirable behaviours like permeability (does not seem to block light?) and shading inconsistency.

have i missed something? how do i get around this? is it part of the "experimental" nature of nodebox?

i noticed that some instances of the identical nodebox objects seem to behave differently, it almost seems unpredictable.
see for example this usage of objects from 'stairs+' (a wonderful mod btw!) where some steel quarter blocks appear shaded and some not, and most sandstone half blocks are bright even though they should be shaded. and on some which are shaded, the shading is not gradual (see just above centre of image)
[img=nodebox shading oddness]http://rm-rstar.com/~sema4/minetest/screenshot_133796228.png[/img]
 

sema4
New member
 
Posts: 4
Joined: Tue Dec 04, 2012 19:06

by sema4 » Mon Dec 10, 2012 21:09

OK i was able to get some answers on the IRC channel

Summary:

1) due to how the system processes light, it cannot properly illuminate the surfaces in a nodebox (ideally any plane within the box needs to be lit differently than the surfaces of the box)

2) paramtype="light" tells the engine to store a value representing the light incident on the node, and to light all the surfaces in the nodebox with this amount of light. this is why the nodebox is lit uniformly and there is no gradual lighting/shading.

3) the appearance of light permeability is an unfortunate side effect of the usage of the internal lighting mechanism provided by paramtype="light".


chat log:


<PilzAdam> sema4, IIRC, Minetest saves the light at the corners of a node; when using nodeboxes this system cant tell wich boxes have to be lit up

<sema4> ok so the necessity for 'paramtype="light"' on a nodebox is due to a known behaviour of minetest engine that is not easily fixed at that time; great. so my second question was -- what SHOULD paramtype="light" do on a normal node, does it indicate that the node is a light source?

<khonkhortisan> it was used on mesecon note blocks, and made light pass through them. Building a box of them doesn't make it dark inside

<sema4> ok, how does that differ from sunlight_propagates = true ?

<celeron55> sema4: the engine stores the brightness of light in the node if paramtype="light", and the brightness of nodeboxes is applied from the brightness in the node itself

<celeron55> sema4: and if paramtype~="light", then the light in the node is effectively 0

<celeron55> sema4: the paramtypes kind of annoyingly expose some internals of the engine, but it's necessary because of the design of it
 

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

by Calinou » Tue Dec 11, 2012 12:26

Stairs, slabs and other Stairs+ stuff let light pass through. This is a feature, not a bug.
Not only making them block light makes them look darker than other objects, it can also feel less realistic (eg. an inverted slab on a ceiling, next to sunlight, blocks light; it is more realistic to make the light go through the ceiling in this case).

Also, too bright is better gameplay-wise than too dark. :)
 

sema4
New member
 
Posts: 4
Joined: Tue Dec 04, 2012 19:06

by sema4 » Wed Jan 09, 2013 23:15

I disagree Calinou. IMHO the correct behaviour should be to have objects shaded according to light falloff whether they are nodeboxes or not. to me it looks strange/inconstent to have smooth light falloff on some nodes but not others. see screenshot:

[img=Nodebox light strangeness]http://rm-rstar.com/~sema4/minetest/light_behaviour_nodebox.png[/img]

On the left are default sandstone blocks, as you can see the engine shades them properly, shading gets gradually darker as distance from the light increases. on the right are nodebox sandstone blocks. it looks like the AVERAGE light on each block is less as distance from the light increases, but each block is shaded uniformly.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 6 guests

cron