Forum

Shadows, Multiple light sources

11 December 2018 14:07
The reason for that 30+ lamps were: they are predefined with specific parameters. So it is … or it would be easy just to switch the needed one, on. Thats it. But it seems, it doesn´t work.

Good workaround, to move them. Thought also about this.

I will try some more things out, maybe it will work. I read somewhere, you can use "scenes.load()" to dynamicly load f.e. objects / lights into your scene. Maybe you can also "unload" by this method. Don´t know Otherwise i will do it like you said: just having max. 4x lights in my scene.
11 December 2018 18:48
they are predefined with specific parameters.
Yes, but that should not be an issue since you can set the lamp parameters dynamically, so I would put the data of my 30 lamps into an array like this:
var my_lamps = [{ x: 22.12, y: -5.27, z: 0,   params: {light_type: "POINT", light_energy: 1,   light_color: [1,0.9,0.8], light_spot_blend: 0, light_spot_size:  0, light_distance: 8}},
                { x: 15.98, y: 11.02, z: 0.5, params: {light_type: "SPOT",  light_energy: 2.5, light_color: [1,  1,  1], light_spot_blend: 1, light_spot_size: 45, light_distance: 15}},
                ....
                ....
                ....

function set_lampdata_for_scene_lamp (scene_lamp_no, data_no) {
  var scene_lamp = m_scs.get_object_by_name ("scene_lamp_"+scene_lamp_no);
  m_trans.set_translation (scene_lamp, my_lamps[data_no].x, my_lamps[data_no].y, my_lamps[data_no].z);
  m_lights.set_light_params (scene_lamp, my_lamps[data_no].params);
}
If you have the two lamp objects in the scene ("scene_lamp_1", "scene_lamp_2"), you can set them up for positions #13 and #30:

set_lampdata_for_scene_lamp (1, 12);
set_lampdata_for_scene_lamp (2, 29);
12 December 2018 21:24
Hey,

wasn´t able to investigate more on this. I think i got some time in the next days.
Have to say: awesome script & awesome help ! It looks like it isn´t that a big deal, beacuse you showed the elegant way, to store all-info about the lamps into an Array ! … Hm, maybe i don´t need to find any other way .

Will try it out, as soon as possible.

Last, but not least: i can understand that this limitation (max. 4x light-shadow casts) makes sense (performance-wise). On the other hand, i would like to descide myself, how many shadows i will cast in my scene !!! I hope this limitation (and maybe the improvement with "hiding lights") will solved one day, when the next-update of "Blend4Web" cames out. Do you hear / read somewhere when the next update will be availible ?
12 December 2018 23:45
Last, but not least: i can understand that this limitation (max. 4x light-shadow casts) makes sense (performance-wise). On the other hand, i would like to descide myself, how many shadows i will cast in my scene !!!
Well, the sun lamp casts accurate shadows over the entire scene, for the other lamps there are certain limitations of quantity and angle. I'm not sure if the number is 4. I made a quick test with 6 point lamps and each one produced shadows. However, the shadow casting stops and light can go through walls if the angle from the source exceeds a limit ("directional shadows").

This is probably the greatest weakness of the engine, therefore, if you have a stagnant, not-too-big scene, I would recommend baking the scene with Cycles. I've used baking in the "Egyptian" demo. If you look closely, you can see that the shadow casting is not accurate if you change the coffin size because that is a dynamic element for which baking is unsuitable (although you could switch textures if you have only two dynamic states like "light on" and "light off").

Do you hear / read somewhere when the next update will be availible ?
IMO, if they were still properly in business, they would not have their forum hammered with SPAM. No devs, no sign of life, no answer to my mail. So, put two and two together… looks like it's been abandoned. Very sad.
14 December 2018 00:48
Hey,

cool Egypitan-Level scene. I guess you can discover some stuff in there. I get about 16fps. Maybe my laptop isnt that performant as i thought . Anyways.

As for the light. It doesn´t matter which form of light. I just need light with shadow (i think spotlights are best solution for my case). And would be great to have 30+ of them. Okay ok…..anyways. Currently it isnt doable. So need to try out your method soon !

Baking could be also a solution. But i will not happen, because it is more effort in my case (UV mapping, etc.), and my client run out of money. So i need a quick n dirty method .

Man so sad about this happening. I read it somewhere, they got internal struggle. So a main-dev kicked out. So his only way to survive was, to build a similar Blend4Web thing. Its called "VERGE 3D". Baaam ! Did you tried it out ? I can´t switch. I am too deep in Blend4web with this project. Would you say, switching over to Verge3D would be wise ? What about other Webfriendly 3D-Solutions ? I tried vanilla "ThreeJS", but i don´t like the Editor. You can´t even save your scene ! What a cumberstone. Can´t understand it. An other Editor looks quite nice: "nunuStudio". Check this guy out. It looks promising. You can also use ThreeJS Plugs etc. But be carefull, its still in beta. So you know some others … ? (i mean…we need to be prepared for the future !!!)
14 December 2018 19:46
Oh, look! There was a sign of life today. Somebody deleted the multiple-thread spammers. But NOT the spam in other threads. I guess there is no time for that. Thirty seconds of maintenance per month is all. LOL.

Its called "VERGE 3D". Baaam ! Did you tried it out ?
I've been using it since October. I like it so far. PBR looks really nice, look at these screenshots from my first attempt, featuring shader->ocean and post processing->Unreal Engine bloom from the Three.js demos:

Image 1
Image 2
Image 3

Would you say, switching over to Verge3D would be wise ?
Well, aside from the fact that you get no more answers and bugfixes here, what's your long-term alternative if B4W is not maintained anymore and starts becoming incompatible with customers' devices? It's annoying because I built my own set of complementing API modules around the B4W API over the course of a year and some (low-level) Blender Python add-ons here and there. Now it looks like I'll have to bust my chops and do it all over again for Three.js, which is the core of Verge. Oh well…

"nunuStudio". Check this guy out.
That's nice, but as a Blender guy I want to use a Blender-integrated kit.

So you know some others … ?
https://en.wikipedia.org/wiki/List_of_WebGL_frameworks
24 December 2018 09:17
Is Antivirus not performing to its potential in your computer? Is your computer running slow after installing any antivirus? If you are indeed having a problem with the mentioned issues and many more others, you can now contact Antivirus customer service.
 
Please register or log in to leave a reply.