sdzen wrote:if I had the amount of ram he has 512 gb I would consider looking outside to remember what the sun looks like :)
neko259 wrote:Yes, dynamic lightning must be implemented. Also we must have an ability for entities to emit light.
neko259 wrote:Yes, dynamic lightning must be implemented. Also we must have an ability for entities to emit light.
celeron55 wrote:The problem with hardware lighting is that you cannot use the voxel lighting and hardware lighting simultaneously without shaders, and nobody is willing to or capable of creating such a system. Including me,
jordan4ibanez wrote:i have taken this on my own to rewrite the lighting to accommodate hd/dynamic/textured lighting with help from members of the irrlicht community. wish me luck.
u8 MapNode::getLight(u8 bankLevel, INodeDefManager *nodemgr) const
{
// Select the brightest of [light source, propagated light]
const ContentFeatures &f = nodemgr->get(*this);
if(f.param_type == CPT_LIGHT)
{
return (
(param1 & 0x0f) * (16 - bankLevel) +
(param1>>4)&0x0f * (bankLevel)
)>>4;
}
if(f.light_source > light)
return f.light_source;
return 0;
}
#define getLight(block,bankLevel) (((block).param1 & 0x0f) * (16 - (bankLevel)) + ((block).param1>>4)&0x0f * (bankLevel))>>4)
wokste wrote:The day / night system currently gives problems. I think we should have fluent transitions. Here is a suggestion for implementation:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
u8 MapNode::getLight(u8 bankLevel, INodeDefManager *nodemgr) const
{
[snip]
}
bankLevel must be an uint8 between 0 and 16. 16 means day, 0 means night. I suggest a sin-like curve for the float.
wokste wrote:A word on efficiency. I do not know what the if statements do, but if statements and type conversions are relatively expensive for a computer. To further improve speed, this can be changed in a macro. (to avoid a function call). This will look somewhat like:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
#define getLight(block,bankLevel) (((block).param1 & 0x0f) * (16 - (bankLevel)) + ((block).param1>>4)&0x0f * (bankLevel))>>4)
kahrl wrote:Umm, you know that a function that is defined inside class {} is inline?
MirceaKitsune wrote:I would like this! Count my vote in :) But yes, make it optional, for people who have old computers or wish to have a lightning system like Minecraft's. Also, would this mean realtime shadows as well? <3
Jordach wrote:MirceaKitsune wrote:I would like this! Count my vote in :) But yes, make it optional, for people who have old computers or wish to have a lightning system like Minecraft's. Also, would this mean realtime shadows as well? <3
Woah woah woah woah woah waoh. Shadows, dont tell me DMs will become evem more scary... O.O
Users browsing this forum: No registered users and 15 guests