Hi,
 
At the moment we're setting up a new and much better forum for you, so we can provide even better support! This is why this forum is in ‘read-only' mode for as long as we're migrating the content.
 
Please visit our brand new forum at https://support.wikitude.com to report your issues.
 
Should you wait for an urgent answer, please contact us via forum@wikitude.com (make sure to include the title of your post, so we can help you more efficiently).
 
Thank you,
The Wikitude Team

RE: 3D lighting and material -- follow-up question

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
3D lighting and material Bernie Roehl 3/3/13 11:36 PM
RE: 3D lighting and material Wolfgang Damm 3/4/13 9:27 AM
RE: 3D lighting and material Bernie Roehl 3/4/13 12:33 PM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/6/13 2:50 PM
RE: 3D lighting and material -- follow-up question Wolfgang Damm 3/7/13 8:59 AM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/7/13 11:04 AM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/7/13 12:41 PM
RE: 3D lighting and material -- follow-up question Wolfgang Damm 3/8/13 12:48 PM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/8/13 2:33 PM
RE: 3D lighting and material -- follow-up question Wolfgang Damm 3/8/13 2:45 PM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/8/13 3:10 PM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/8/13 4:35 PM
RE: 3D lighting and material -- follow-up question Wolfgang Damm 3/15/13 3:15 PM
RE: 3D lighting and material -- follow-up question Bernie Roehl 3/15/13 3:19 PM
RE: 3D lighting and material -- follow-up question Peter Bartos 2/4/15 4:10 PM
RE: 3D lighting and material -- follow-up question Christian E 2/10/15 11:25 AM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/18/16 11:03 AM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 5/18/16 2:34 PM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/18/16 3:51 PM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 5/18/16 4:00 PM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/18/16 9:59 PM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/19/16 9:53 AM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 5/19/16 5:00 PM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/20/16 8:55 AM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 5/23/16 3:07 PM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/23/16 4:47 PM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 5/23/16 5:23 PM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 5/24/16 2:01 PM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 6/15/16 9:20 AM
RE: 3D lighting and material -- follow-up question Marton Feovenyessy 6/15/16 3:58 PM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 6/15/16 4:03 PM
RE: 3D lighting and material -- follow-up question Roland Hufnagel 6/16/16 10:51 AM
3D lighting and material
Answer
3/3/13 11:36 PM

I'm curious if there's support for lighting in a 3D model.  I'd like to position a light in the scene so it matches the direction of the sun (in order to make the model fit into its surroundings better).

Also, can inidividual components of a model be animated?  I'm thinking of something like a treasure chest that opens up.

Thanks in advance for any information.

 


RE: 3D lighting and material
Answer
3/4/13 9:27 AM as a reply to Bernie Roehl.

Lighting is already supported, however you won't be able to change just the position of the light. Transformations are currently applied on the complete loaded model scene. Additionally we are working on supporting animations exported from 3D modeling tools and will let developers know as soon as it is available.

I like the idea of matching lightning to the sun's direction and as we already discussed this idea internally a while back, we might provide this as built in functionality somewhen in the future.

 


RE: 3D lighting and material
Answer
3/4/13 12:33 PM as a reply to Wolfgang Damm.

If you can provide built-in sunlighting capability, that would be even better.  Less code for me to write.   :-)

Support for exporting 3D animations would also be great, and would open up lots of possibilities.

Thanks for your prompt answer, and thanks for Wikitude!

 


RE: 3D lighting and material -- follow-up question
Answer
3/6/13 2:50 PM as a reply to Bernie Roehl.

I've been experimenting with lighting.

I create my file in Blender, with a single light source.  I export it as FBX, and bring it into the Wikitude 3D encoder.  No errors or warnings.

If find that if I use a point light, it has no effect -- the object is lit uniformly, the same as if I don't have the point source there.  The scene hierarchy display does show my point light source.

If I use a directional light (i.e. "sun" in Blender), it works -- but of course, half of my object is black because it receives no light.  This is a problem, since I animate the rotation (i.e. heading) of the object at runtime.

Am I overlooking something?

 


RE: 3D lighting and material -- follow-up question
Answer
3/7/13 8:59 AM as a reply to Bernie Roehl.

Point light is supported, so it would be great to have a look at your .fbx and/or blender file. If you aren't comftable posting it in the forum, please send it as email (or a link to the file) to info AT wikitude DOT com.

Regarding directional light, you can set an ambient light so the backside won't be black. Have you tried that?


RE: 3D lighting and material -- follow-up question
Answer
3/7/13 11:04 AM as a reply to Wolfgang Damm.

Thanks, I'll email you a zip in a few minutes.  I appreciate the help.

 


RE: 3D lighting and material -- follow-up question
Answer
3/7/13 12:41 PM as a reply to Bernie Roehl.

One interesting thing I notice is that when I use a directional light source, the Wikitude 3D Encoder shows me the light's properties when I click on it in the hierarchy view.  It has direction and light color.

However, if I use a point light, I see no properties at all when I click on it in the hierarchy.

I've also tried using a directional light and increasing the ambient value (Blender's World button, Ambient Color setting) but it has no effect.

I've also looked at the FBX file, and in the material properties I see:

 

Property: "AmbientColor", "ColorRGB", "",0.5382,0.5382,0.5382

Property: "AmbientFactor", "double", "",1.0000

Property: "Ambient", "ColorRGB", "",0.5,0.5,0.5
 
And in AmbientRenderSettings I see:
 
AmbientLightColor: 0.5,0.5,0.5,0
 
... so that all seems reasonable.
 
If I can get some ambient light into the scene, I would be fine with a single directional light.  Alternatively, if i could have two or three directional lights, that would be fine too.
 
Thanks in advance for any help or suggestions.

RE: 3D lighting and material -- follow-up question
Answer
3/8/13 12:48 PM as a reply to Bernie Roehl.

Thanks for the model file. It helped to speed up things. So here's what I found out:

First the bad news: Blender does not export point lights correctly when using fbx. They end up without attenuation values (regardless of what is defined as falloff). This is nothing under our control and might change with a future exporter version.

However: The way point lights are exported is picked up as an ambient light source in our encoder. Therefore you can use a point light in blender to define ambient light. Additionally define a directional light and you should be able to get the desired effect.

A side note to DAE:

If exporting the scene as DAE you have to manually delete the attenuation paramters of the point light (which seem to be exported wrong as well) within the .dae file.


RE: 3D lighting and material -- follow-up question
Answer
3/8/13 2:33 PM as a reply to Wolfgang Damm.

First of all, thanks for the suggestion about using a point light to produce ambient lighting.  I would never have thought of trying that.

I notice that the directional light doesn't appear to be pointing in the same direction in the encoder as it is in Blender.  If I have the directional light pointing straight down in Blender (illuminating the top half of my model), it appears to come from the right side in the encoder.  It's probably something to do with the coordinate system orientation being different (Blender has Z "up", whereas almost everyone else, including Wikitude, has Y "up").

At first I thought it might be a problem with Blender's FBX exporter (as it turned out to be for the point light issue), but when I look at the file in Autodesk's FBX viewer plugin for Quicktime it's correct.

 

 

 


RE: 3D lighting and material -- follow-up question
Answer
3/8/13 2:45 PM as a reply to Bernie Roehl.

I did see this happing and we will have a look at this next week. Have you tried it on the device? Is the light correctly rendered there?

FYI: One addition to the ambient light:

The odd thing is that exporting an ambient light from maya to fbx (where an ambient light is just another light type, like point, sun, spot ) will produce exactly this: a point light without attenuation. Still not intuitve but it explains why the encoder does handle a point light this way.


RE: 3D lighting and material -- follow-up question
Answer
3/8/13 3:10 PM as a reply to Wolfgang Damm.

I'll try it on the device and let you know what the results are.  I would think they would be the same, since you're (probably) using the same OpenGL ES based renderer in both the encoder and the SDK.

Yes, very strange about the point light.  It sounds like the FBX exporter in Blender and one in Maya have the same issue with point lights.  That's surprising, since I believe the Blender FBX exporter is written in Python while the one in Maya is (I assume) written using Autodesk's FBX SDK.

 

 


RE: 3D lighting and material -- follow-up question
Answer
3/8/13 4:35 PM as a reply to Bernie Roehl.

I just verified that the rendering on the device is the same as in the encoder.

 


RE: 3D lighting and material -- follow-up question
Answer
3/15/13 3:15 PM as a reply to Bernie Roehl.

Hi, I've good news. We fixed the issue this week and it will be in the upcoming Wikitude 3d Encoder release, only days away ;). You will get an automatic update notficiation once we publishe the release.


RE: 3D lighting and material -- follow-up question
Answer
3/15/13 3:19 PM as a reply to Wolfgang Damm.

That's great news!

Thanks very much for all your hard work, Wolfgang.  It's much appreciated.

Have a good weekend.

 


RE: 3D lighting and material -- follow-up question
Answer
2/4/15 4:10 PM as a reply to Wolfgang Damm.

Hi,

please, what is currently the recommended way to export a model from Blender to Wikitude 3D Encoder?

I'm trying to add ambient light to my scene. Ambient light setting from Blender is ignored. I tried both DAE and FBX export.

When I try point light, I'm unable to import the DAE model. After removing attenuation parameters, DAE model is imported, but light is a point light and not ambient light.

Best regards,

Peter


RE: 3D lighting and material -- follow-up question
Answer
2/10/15 11:25 AM as a reply to Peter Bartos.

Add a point light and a directional light (sun). Remove the attenuation parameters from the point light in the exported DAE file (constant_attenuation, linear_attenuation, quadratic_attenuation) but leave the color tag. The point light will be displayed as ambient light.

Hope that helps,
Christian

 


RE: 3D lighting and material -- follow-up question
Answer
5/18/16 11:03 AM as a reply to Christian E.

Hi there,

I'm also having some dificulties in setting the lights in a Blender model and export it in FBX for wikitude 3d model encoder.

The only way my model lit perfectly in the encoder is when I set a single sun as light source, and nothing else. In this case, my model looks nice, but the other side is too dark (black).
Setting higher intesity for the sun in Blender, moving closer-farer does not make any change in the encoder.
I would love to add an ambient light but adding a point light after my sun is added will make it black-and white in the encoder, and adding only a point light will make it weird looking, like fully tinted to its material color (no shadings, edges, etc.)
However, if I add a point light and after that adding a sun will make it looks nice again (apart from that the other side is still too dark)

Looks like the encoder ignores all lights except the last one added in Blender?
Or am I missing something here?

Thanks in advance!

Marton


RE: 3D lighting and material -- follow-up question
Answer
5/18/16 2:34 PM as a reply to Marton Feovenyessy.

Can you check the amibient light setting of your model, as discussed here: http://www.wikitude.com/developer/developer-forum/-/message_boards/view_message/921126


RE: 3D lighting and material -- follow-up question
Answer
5/18/16 3:51 PM as a reply to Roland Hufnagel.

Hi Roland,

Thanks for your answer and the link! Yes, my ambient color is set to white, and the World's Environment lightning is also set to white.

I'm sorry if it's a Blender issue, but I'm not sure, as if I render an image within Blender, I can see the object correctly lit around with the ambient light and it changes accordingly if I for example increase the Energy for the Environmental Lighting.
However, if I export it to fbx I still see it halfway dark and it does not seem to react for any changes.

Thanks and kind regards,

Marton


RE: 3D lighting and material -- follow-up question
Answer
5/18/16 4:00 PM as a reply to Marton Feovenyessy.

Ok.

You can check the fbx exported from Blender with the Autodesk FBX Reviewer. If you turn on lighting in the FBX Reviewer and the model appears black, this indicates that the ambient light color in the fbx is black. 

If the ambient light has an effect in the FBX Reviewer you can send us the file and we take a look at values imported in the Wikitude3dEncoder.


RE: 3D lighting and material -- follow-up question
Answer
5/18/16 9:59 PM as a reply to Roland Hufnagel.

Great idea, thanks!

I have checked it in Autodesk Preview and it looked perfect! No dark half on the unlit side.
I would be very happy if you could take a look at my file. :)
I will post it tomorrow when I arrive in the office.

Thank you and have a nice evening,

Marton


RE: 3D lighting and material -- follow-up question
Answer
5/19/16 9:53 AM as a reply to Roland Hufnagel.

Hello,

I need to correct myself, as I see in Autodesk Preview, the bottom (unlit) part of the object is not black, but solid, tinted material color, while the top, the lit side is perfect.
In the encoder, the bottom part is dark/black and the top is OK. For some reason, the whole object is way darker in the encoder than in the Autodesk Preview.

Thank you in advance for taking a look at my files:

Blend file: https://www.dropbox.com/s/6g6opujdgu6tlyq/sziv.blend?dl=0

FBX: https://www.dropbox.com/s/r5zp1cyd0ly0ff2/sziv.fbx?dl=0

Kind regards,

Marton


RE: 3D lighting and material -- follow-up question
Answer
5/19/16 5:00 PM as a reply to Marton Feovenyessy.

Thx for the files. The settings in Blender seem to be ok. However, the fbx file still shows ambient light black. So it's the Blender exporter who is causing this.

I will try to find a workaround for that within the next days.


RE: 3D lighting and material -- follow-up question
Answer
5/20/16 8:55 AM as a reply to Roland Hufnagel.

Awesome, thank you! Highly appreciated! :)

(I told my boss, that your support is excellent, so I'm pushing him to buy a license ;) )


RE: 3D lighting and material -- follow-up question
Answer
5/23/16 3:07 PM as a reply to Marton Feovenyessy.

Can you try the following: 

1. add a point light to the scene
2. set the color of that light to your preferred ambient light value
3. set it to invisible (i.e. disable the eye icon) in the scene graph view

Export the model to fbx and convert it with the encoder.

I had some problems loading of the wt3, but maybe it works with your version of the SDK. That is, no guarantee that it works.

A fix for the import problems is ready and will be available with the next release of the SDK.


RE: 3D lighting and material -- follow-up question
Answer
5/23/16 4:47 PM as a reply to Roland Hufnagel.

Hey Roland,

Thanks a lot for the new workaround!
Unfortunately it didnt change anything, my object is still half-way dark/tinted no matter how I export it, with or without other light sources, hidden from viewport, hidden from rendering, the result is always the same. :(

I think that all of my lighting problems would immediately disappear if there was a chance to use more than just one light source. (i.e. placing a directional above and below)

Is there any planned date for the release of the SDK version that contains the fixed import methods?

Thank you and kind regards,

Marton


RE: 3D lighting and material -- follow-up question
Answer
5/23/16 5:23 PM as a reply to Marton Feovenyessy.

Sorry, I forgot one point. Try it with 

1. add a point light to the scene
2. set the color of that light to your preferred ambient light value
3. set Falloff: constant
3. set it to invisible (i.e. disable the eye icon) in the scene graph view

Please try again. 

Regarding the multi-lighting: I fully agree, but it will not be available soon. Sorry. If you need a more sophisticated 3D rendering you may consiter using the Wikitude Unity Plugin.


RE: 3D lighting and material -- follow-up question
Answer
5/24/16 2:01 PM as a reply to Roland Hufnagel.

Dear Roland,

Thank you for the tip! Unfortunately it didn't help me.
I've been playing with the settings for hours now, but still couldn't achieve an evenly lit object in my cordova app.
The best I could make is the one I have linked above, when the lit side is perfect, but the other is dark.
Am I the only one who has problems with this? :)

I cannot switch to Unity as my app is created in Cordova, but I wonder if there was a way to make the export without any lights and add a single light source in the encoder or within javascript.
I wouldn't mind the dark half of the object if it doesn't rotate towards me... :)

Thank you and best regards,

Marton

 


RE: 3D lighting and material -- follow-up question
Answer
6/15/16 9:20 AM as a reply to Marton Feovenyessy.

Sorry to come back to you only now. 

I had another look at the ambient light settings for Blender. I tested with the Wikitude3deEncoder 1.4 available via our download page and the settings I described in my previous post, and it works. 

Please make sure to apply the properties of the point light as shown below. The color point light source in Blender is then used as the ambient light of the scene in the Wikitude3dEncoder. 

 

Attachment

Attachments: blender-ambient-point-light.png (55.9k)

RE: 3D lighting and material -- follow-up question
Answer
6/15/16 3:58 PM as a reply to Roland Hufnagel.

Dear Roland,

Thank you very much for your efforts on further helping me out, really appreciate it!
Among others I tried exactly this method, but unfortunately could not achieve any improvement on the lights.

Thank you and best regards,

Marton


RE: 3D lighting and material -- follow-up question
Answer
6/15/16 4:03 PM as a reply to Marton Feovenyessy.

If I open the fbx attached below with the encoder I see the 3D model without any black faces. You can see the settings in the blender file attached.

Attachments: sziv-point.zip (11,840.4k)

RE: 3D lighting and material -- follow-up question
Answer
6/16/16 10:51 AM as a reply to Roland Hufnagel.

Maybe I found the reason why it didn't work for you: I realize that the order of light sources matters. 

As you hopefully can see, the order used in the blender attachment in my previous posting provides the lighting and ambient light expected in the encoder. 

I adjusted the encoder accordingly. So in the next release of the SDK 5.2 and the encoder 1.6 the order of the light sources will not matter anymore.

Hope that helps.