helix-toolkit / helix-toolkit

Helix Toolkit is a collection of 3D components for .NET.
http://helix-toolkit.org/
MIT License
1.89k stars 672 forks source link

RenderEnvironmentMap doesn't work in v2.21.0 #1767

Closed sinaone1 closed 2 years ago

sinaone1 commented 2 years ago

Hello I had version 2.20.0.0 HelixToolkit.Wpf.SharpDX and in that version I used from PhongMaterial to have reflection and everything was ok, This is my code

Return New PhongMaterial With { .AmbientColor = Colors.White.ToColor4(), .DiffuseColor = Colors.White.ToColor4(), .SpecularColor = Colors.Black.ToColor4(), .SpecularShininess = 25000, .RenderEnvironmentMap = True, .EnableFlatShading = True }

But I just updated version to v2.21.0 and now reflection doesn't work. Could you tell me please something in codes has been changed and I have to change my way to load reflection or there is a bug? Thank you

holance commented 2 years ago

Could you create a sample project to show this issue? I haven't been able to reproduce this issue. Could you also try 2.21.1 beta from nightly build?

sinaone1 commented 2 years ago

Sorry it late to answer but I found the problem In the old version after you load EnvironmentMap you can set IsRendering=false and hide background because it will be more prettier I think. But now in new version if you do that , it will disable also reflection. I attached an example here and there is a button to set IsRendering and you could test it. Example.zip Thank you

holance commented 2 years ago

Yes, that is intentional since it doesn't make sense to render environment map on objects without rendering it. What's your use case for not rendering the environment map at the background?

sinaone1 commented 2 years ago

I have a 3d machine and because focus is just on the machine and I'm using EnvironmentMap just to be more realistic,So I must hide the background to don't make any confusion to see machine. Do you think is there any way like the last version that I keep reflection of EnvironmentMap but also don't show that?

holance commented 2 years ago

Use EnvironmentMap.SkipRendering = true to disable environment map background rendering.

sinaone1 commented 2 years ago

Thank you so much

sinaone1 commented 2 years ago

Sorry how can I update the helix to version 2.21.1? Because we don't have it in nuget

holance commented 2 years ago

https://www.myget.org/F/helix-toolkit Install the 2.21.1 beta build.

sinaone1 commented 2 years ago

Thank you again