Lighting in Html

I am looking at a project that someone has written for me. The game basically is a cube being loaded when you press a button. It works fine on the windows release but when I tried it on Html release, the lighting of the cube was weird. It was very dark and didn’t have its color. Sorry for the imprecise vocabulary.

Looking at the material that is applied on the cube I can see that there are many options to tweak. There are also some for “Mobile”. Can I get the material to show in html by tweaking some of these properties or is it a limitation of html that stops it from showing “dynamic” lighting if that is the right words to describe this setting since it is “dynamically” being added to the scene?

I couldn’t upload the asset file for the material but I hope the screenshots help?

and this one:

and this is how it looks on a browser:

It looks fine in the windows packaged version though.

what OS (and version) and browser (and version) are you using?

Windows 10, Chrome: Version 52.0.2743.116 m

thanks for the info!

some webGL features might not be available - using “mobile” setting might help.

mobile and browser have similar behavior/capabilities – where as the desktop has more…

just out of curiosity, can you also test your project with firefox nightly? that sometimes have more features turned on…

otherwise, is it possible for you to upload your packaged HTML5 test project live for me to take a look at it?

Thanks. The whole project is quite big. I think you would only want the material file, right? As you can see the cube next to the balls with vanilla lighting configuration is being rendered fine. regardless, Is there a canonical place for hosting files on this forum?

I will try testing with the setting and Firefox and report tomorrow.

thanks for the sample prototype - after packaging it and running it in the browser - the (browser) console output is flooding with webgl errors.

one of them, “framebufferTexture2D: level must be 0”

  • is something that webGL2 (OpenGL ES 3.0) will be providing

but, there are some caveats:

  • most browsers “release” does not support webgl2 yet
  • point your browsers to the following test site to see this live:

WebGL Framebuffer Test Against WebGL 2

you could use firefox nightly or chrome canary to run webgl2 content.

Getting a WebGL Implementation

BUT! currently, UE4 is bundled with emscripten SDK 1.35.0 – and this does not support webGL2.

however, i just found out from emscripten developer today that the next stable release with webGL2 support (as well as WebASM) is slated for this janurary.

this task is being tracked on jira with the following ticket ID: UEPLAT-828

Thanks. That makes things a bit more clear.
Could you clarify what the difference is between the cube and the spheres that makes one render fine but not he other?
Is it the lighting that webGL2 fails to handle or is the material and its texture? What is the quickest fix to this prototype to make it render with no problem?

the only thing i can think of is that the box was pre-built during the packaging (cook) stage. the molecules are generated and may not have the materials baked to be ready to draw.

i can look at this more on monday. i have some release cycle task i need to look at right now.

out of curiosity - can you try to pre-build one or two of them in the editor, hide them and see if the rendering results will yield what you’re looking for…

Thanks. Well I don’t really know much about how lighting works. the shapes are simple. They are the trivial sphere meshes. But Isn’t the problem the lighting part and the fact that the material is supposed to dynamically respond to the light? How can I “cook” the material if it is going to be processed on the fly? Feel free to direct me to some relevant links if that sounds too dumb! :slight_smile:

hey shah,

let me get back to you after the labor day weekend - i have a high priority task for the just released 4.13.

i’ll take a look at your code and objects a little deeper then. but before i do, are you assigning a different material to your molecule objects from the cube one?

i was wondering if you, for example, made your molecules out of clones of the cubes - would they show up properly?

i’m still thinking it’s a webGL2 issue that’s not quite fully supported yet. but i need know see how your materials are defined to see what’s different from the cube vs the spheres.