unreal_netfly

My character needs to receive lighting and create shadows. The upper body receives the front light and the lower body receives the light from the back. What is the cause of this? If no shadow is produced, its lighting effect will be normal.
QQ截图20190501130438.png

2.png


This is the effect I want, but this method does not currently produce a shadow. If a shadow is produced, the effect is the same as above.
111.png

----------------------------------------------------
the 3.8beta branch, imports the 3.7 version of the resource will crash...
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Аватара пользователя
unreal_netfly
  • Сообщения: 36

Mario

Regarding importing 3.7 assets with the 3.8-beta runtime, please note that we do not support compatibility between versions! You have to re-export your assets from 3.8-beta to use them with the 3.8-beta runtime.

Regarding the lighting issue, maybe it's because the material has two sided enabled? Another issue could be missing normals which I think we currently let the ProceduralMesh generate automatically.
Аватара пользователя
Mario

Mario
  • Сообщения: 2504

unreal_netfly

badlogic писал(а):Regarding importing 3.7 assets with the 3.8-beta runtime, please note that we do not support compatibility between versions! You have to re-export your assets from 3.8-beta to use them with the 3.8-beta runtime.

Regarding the lighting issue, maybe it's because the material has two sided enabled? Another issue could be missing normals which I think we currently let the ProceduralMesh generate automatically.
I did some work on the normals and it looks normal now.
111.png
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Аватара пользователя
unreal_netfly
  • Сообщения: 36

Mario

We could create another set of materials we ship with the plugin that generate the normal like you do in your material. I'm unsure if we want those to become the default materials though. What do you think?
Аватара пользователя
Mario

Mario
  • Сообщения: 2504

unreal_netfly

badlogic писал(а):We could create another set of materials we ship with the plugin that generate the normal like you do in your material. I'm unsure if we want those to become the default materials though. What do you think?
I think it is possible to preset several common materials in the plugin for developers to choose.

----------------------------------------------
The second question: Is it possible to add the corresponding Attach method, because in some cases we will separate the character from the weapon, so we need to attach the weapon to the API of the character. If this is not allowed, then if the Socket can be exposed, we can choose to attach some components to the Socket.

For example, the screenshot below: we can select the corresponding Bone in "Parent Socket" and attach it to it.
3.png
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Аватара пользователя
unreal_netfly
  • Сообщения: 36

Mario

Cool, then we'll add lit materials to the plugin.

Regarding the sockets, I'm afraid I don't quite understand. A Spine object doesn't expose any sockets. For attachable items, you want to use Spine's skin feature, or the bone follower component. With the bone follower component you can add any type of UE4 object to your skeleton. The only problem with this is rendering order.
Аватара пользователя
Mario

Mario
  • Сообщения: 2504

Max Garena

Mario писал(а):Cool, then we'll add lit materials to the plugin.

Regarding the sockets, I'm afraid I don't quite understand. A Spine object doesn't expose any sockets. For attachable items, you want to use Spine's skin feature, or the bone follower component. With the bone follower component you can add any type of UE4 object to your skeleton. The only problem with this is rendering order.
Hello. My character casts no shadow. Are there any options how to fix this? If you change the material of the normal, a shadow appears, but something incomprehensible happens to the character. Previously, everything was done by default. What happened? Is there a lesson or document to read about this problem? Thx. Unreal 4-26/ SPine 3899
Max Garena
  • Сообщения: 17

Harald

The SpineUnlitNormalMaterial Material by default does not cast a shadow because the Material property Material - Blend Mode is set to Translucent. But you can enable Cast Dynamic Shadow as Masked to enable shadow casting.

As you said "but something incomprehensible happens to the character": could you share a screenshot or video of what happened?

May I ask what you have updated which started the problem to happen: Did you update spine-ue4, or did you switch from an older version of Unreal Engine to 4.26? If you updated spine-ue4, when was the last time that you updated approximately?
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):The SpineUnlitNormalMaterial Material by default does not cast a shadow because the Material property Material - Blend Mode is set to Translucent. But you can enable Cast Dynamic Shadow as Masked to enable shadow casting.

As you said "but something incomprehensible happens to the character": could you share a screenshot or video of what happened?

May I ask what you have updated which started the problem to happen: Did you update spine-ue4, or did you switch from an older version of Unreal Engine to 4.26? If you updated spine-ue4, when was the last time that you updated approximately?
Previously,(Unreal 4-23 works fine shadow by default) everything worked by default. Shadows worked as expected. Now we need to switch something somewhere. What for? Why couldn't leave it as it is? I don't understand what you are talking about. Where should I switch? In the materials? What kind of material? There are 4 of them. If it's not difficult to attach a screenshot please. Normal blend material, I dug there, nothing helped.
https://i.imgur.com/wPLnQkC.png
Max Garena
  • Сообщения: 17

Harald

Max Garena писал(а):Previously,(Unreal 4-23 works fine shadow by default) everything worked by default. Shadows worked as expected. Now we need to switch something somewhere. What for? Why couldn't leave it as it is?
Are you saying that you upgraded from Unreal 4.23 to 4.26 and left spine-ue4 untouched? If so, then I assume that the default behaviour of Unreal Engine materials changed to provide more performance oriented default values. We could consider changing (i.e. enabling) this material flag in the SpineUnlitNormalMaterial, but we would first need to have a look at previous behaviour across multiple UE4 versions to be sure these changes are reasonable.

In general it is not advisable to upgrade Unreal Engine if you want all behaviour to remain unchanged.
Max Garena писал(а):I don't understand what you are talking about.
What did you not understand?
Max Garena писал(а):Where should I switch? In the materials? What kind of material? There are 4 of them
As I said above:
Harald писал(а):The SpineUnlitNormalMaterial Material
Max Garena писал(а):If it's not difficult to attach a screenshot please. Normal blend material, I dug there, nothing helped.
Your screenshot shows that you have found and enabled the parameter and the preview shows a cast shadow. Unfortunately I fail to see what your current problem is as the text you have posted is contradicting your screenshot.
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Hello/ in fact of the matter!!!! Everything is fine in the material editor, but there is NO SHADOW in the engine !!!!! this is the crux of the problem.
Max Garena
  • Сообщения: 17

Harald

I assume that you pressed Compile and Apply in the material editor.

Could you please verify that the material is actually used on your SkeletonRenderer in the scene, and that it's not a different one? You could quickly test this by changing anything else at the material (e.g. connect a color to the emissive pin) and then hitting Apply, if it does change your Skeleton in the scene you can be sure.
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):I assume that you pressed Compile and Apply in the material editor.

Could you please verify that the material is actually used on your SkeletonRenderer in the scene, and that it's not a different one? You could quickly test this by changing anything else at the material (e.g. connect a color to the emissive pin) and then hitting Apply, if it does change your Skeleton in the scene you can be sure.
Hello/ again/ yes, the material changes. Changes are taking place. But there is no shadow. Thx
Max Garena
  • Сообщения: 17

Harald

Unfortuantely we still could not reproduce your issue on our end.

When I created a new scene in UE 4.26, add an actor with components Spine Skeleton Animation and Spine Skeleton Renderer, assign the atlas and skeletonData, it initializes by default Normal Blend Material with the SpineLitNormalMaterial material assigned casting a shadow by default, or with SpineUnlitNormalMaterial, where the property Cast Dynamic Shadow as Masked needs to be enabled to cast a shadow.

What do you have assigned at your Spine Skeleton Renderer component under Normal Blend Material?
I mean this parameter here: https://prnt.sc/yesazf
Are you sure that Spine Skeleton Renderer parameter Lighting - Cast Shadow is enabled?
See this parameter here: https://prnt.sc/yesfh1

Actually, if the material preview shows a cast shadow in the preview, then there is either
a) the material is not used. But this cannot be the case if you say that other material modifications show up in the scene.
b) something wrong with the scene or component setup, not casting a shadow from the mesh, and the material is not the problem.
b) something wrong/corrupted with the asset state perhaps? You could test this by creating a new UE4 project and importing the Spine plugin again from a clean state and adding a skeleton again. If it works in a new project but not in your existing one, then perhaps re-importing the plugin or the assets helps?

Also please be sure the use the latest git status from both the spine-ue4 and spine-cpp runtimes. Updating only spine-ue4 but not spine-cpp and copying it over again is a common mistake.
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):Unfortuantely we still could not reproduce your issue on our end.

When I created a new scene in UE 4.26, add an actor with components Spine Skeleton Animation and Spine Skeleton Renderer, assign the atlas and skeletonData, it initializes by default Normal Blend Material with the SpineLitNormalMaterial material assigned casting a shadow by default, or with SpineUnlitNormalMaterial, where the property Cast Dynamic Shadow as Masked needs to be enabled to cast a shadow.

What do you have assigned at your Spine Skeleton Renderer component under Normal Blend Material?
I mean this parameter here: https://prnt.sc/yesazf
Are you sure that Spine Skeleton Renderer parameter Lighting - Cast Shadow is enabled?
See this parameter here: https://prnt.sc/yesfh1

Actually, if the material preview shows a cast shadow in the preview, then there is either
a) the material is not used. But this cannot be the case if you say that other material modifications show up in the scene.
b) something wrong with the scene or component setup, not casting a shadow from the mesh, and the material is not the problem.
b) something wrong/corrupted with the asset state perhaps? You could test this by creating a new UE4 project and importing the Spine plugin again from a clean state and adding a skeleton again. If it works in a new project but not in your existing one, then perhaps re-importing the plugin or the assets helps?

Also please be sure the use the latest git status from both the spine-ue4 and spine-cpp runtimes. Updating only spine-ue4 but not spine-cpp and copying it over again is a common mistake.
if it's not difficult for you, look at the project file. Otherwise we will correspond for so long. Thx
https://drive.google.com/file/d/1MN5v9r4UpNX-msNAmediFxHgJlHfxjHO/view?usp=sharing
Max Garena
  • Сообщения: 17

Harald

Thanks for sending over the reproduction project. I could now reproduce the problem you are seeing.

It seems to be a problem with lighting or settings caching (or similar), as I could fix the problem by setting the Light Source Mobility from Stationary to Movable and then back to Stationary again. After switching it once it was casting a shadow in every mobility-mode.

https://prnt.sc/yqfl22
https://prnt.sc/yqfcnp

Strangely when trying it out in a local 4.26 test project with the Spineboy asset, I could suddenly see the same issue arising, which I could swear has not occurred there before. Perhaps a recent UE4 update has changed behaviour in this regard, or circumstances just changed.
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Thank you, I'm glad you helped me! It's a pleasure to do business with you! See u!
Max Garena
  • Сообщения: 17

Harald

Thanks for your kind words! We're very glad we could resolve the problem.
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):Thanks for your kind words! We're very glad we could resolve the problem.
there is such a feature. When I bake the light, the shadow of the character disappears. If not baked, the print "Preview"and the quality of other shadows is weak.
https://i.imgur.com/dcJAUut.png
Max Garena
  • Сообщения: 17

Harald

This sounds as if the light is not set to cast realtime shadows but baked shadows (baked lighting). Does the shadow also disappear when the light is set to dynamic (non-baked lighting)?
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):This sounds as if the light is not set to cast realtime shadows but baked shadows (baked lighting). Does the shadow also disappear when the light is set to dynamic (non-baked lighting)?
https://i.imgur.com/c6kLa1s.png
https://i.imgur.com/06CihAt.png
https://i.imgur.com/0a9cpCK.png
Max Garena
  • Сообщения: 17

Harald

I don't quite understand why the light is treating the movable Spine Skleton Renderer this way, why it tries to treat it as if it were a static object, only casting baked shadow. This behaviour is rather inconsistent. Unfortunately I could not find any material or component settings that would solve this issue with Blend Mode Translucent.

Thus the solution (at least for now) should be to change the blend mode of the SpineUnlitNormalMatial parameters as follows:
  1. Change Blend Mode to Masked.
    ue4-material-masked.png
  2. Connect the Opacity Mask input pin from the same Multiply output pin that is going to the now grayed-out Opacity input pin.
    ue4-material-opacity-mask.png

Could you please give this a try and let us know if it fixes the issue for you as well? Then we can include an additional material with the spine-ue4 runtime for casting shadows with these settings.
У вас нет необходимых прав для просмотра вложений в этом сообщении.
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):I don't quite understand why the light is treating the movable Spine Skleton Renderer this way, why it tries to treat it as if it were a static object, only casting baked shadow. This behaviour is rather inconsistent. Unfortunately I could not find any material or component settings that would solve this issue with Blend Mode Translucent.

Thus the solution (at least for now) should be to change the blend mode of the SpineUnlitNormalMatial parameters as follows:
  1. Change Blend Mode to Masked.
    ue4-material-masked.png
  2. Connect the Opacity Mask input pin from the same Multiply output pin that is going to the now grayed-out Opacity input pin.
    ue4-material-opacity-mask.png

Could you please give this a try and let us know if it fixes the issue for you as well? Then we can include an additional material with the spine-ue4 runtime for casting shadows with these settings.
Hello! the result is already better! But the problem is in the translucency of the spine texture. They look terrible.
https://i.imgur.com/xjvoRM2.png
Max Garena
  • Сообщения: 17

Harald

Do you mean the noisy pixels around the feet of the skeleton? Or the dark outline around the parts?

Unfortunately it seems that UE4 Materials don't allow for a combinartion of both alpha test ("masked", binary 0 or 1) and alpha blend (gradually translucent) functionality. So I'm afraid when using Blend Mode Masked, you sacrifice gradual alpha blending (semi-transparent regions), while on the other hand, when using Translucent blending, it will not write to the shadow buffer, unless setting the light source Mobility parameter to Movable to still cast a shadow on translucent materials. As an alternative, you could split the mesh in two and assign different materials, but that's not a very elegant solution. So I assume setting the light source Movable seems like the best option for your scenario unfortunately.

It's a pity that UE4's materials don't provide more fine-granular adaptations of these simple parameters. :(
Аватара пользователя
Harald

Harri
  • Сообщения: 2778

Max Garena

Harald писал(а):Do you mean the noisy pixels around the feet of the skeleton? Or the dark outline around the parts?

Unfortunately it seems that UE4 Materials don't allow for a combinartion of both alpha test ("masked", binary 0 or 1) and alpha blend (gradually translucent) functionality. So I'm afraid when using Blend Mode Masked, you sacrifice gradual alpha blending (semi-transparent regions), while on the other hand, when using Translucent blending, it will not write to the shadow buffer, unless setting the light source Mobility parameter to Movable to still cast a shadow on translucent materials. As an alternative, you could split the mesh in two and assign different materials, but that's not a very elegant solution. So I assume setting the light source Movable seems like the best option for your scenario unfortunately.

It's a pity that UE4's materials don't provide more fine-granular adaptations of these simple parameters. :(
Thx!
Max Garena
  • Сообщения: 17


Вернуться в Runtimes