Closed MoritzBrueckner closed 2 years ago
Maybe fixed in the latest Kinc-revision.
PS: To test OpenGL/Direct3D11 differences, just compile directly for OpenGL and Direct3D 11 - no need for Krom detours, that just makes it more complicated for everyone.
Checked with your sample in Kha with Direct3D11 and a new Krom build that's actually largely unrelated to the version of Krom you are using is triggered.
Can confirm that it's fixed now, thanks a lot!
Describe the bug When using
gl_FrontFacing
in a shader and the cull mode is set toNone
, its result differs between the html5 target and the Krom target using D3D11. In the attached example project, a blue sqare is drawn in casegl_FrontFacing
is true (this happens on Krom) and a red square is drawn in the opposite case (happens on html5).I noticed that front- and back-facing is set differently based on the cull mode in the backend sources for those targets (permalinks for d3d11, OpenGL and html5), is this because of a different default winding order? Maybe this is related to this issue?
To Reproduce Example project: FrontFaceTest.zip
Run the attached project. On vanilla Krom the drawn geometry is incorrect (not a rect but some line-like thingy), but you can still see the blue color. When using Armorcore, the geometry is correct and you see the blue color.
Expected behavior Both targets should show the same color.
Screenshots Krom:![Krom screnshot](https://user-images.githubusercontent.com/17685000/157554001-28b2df0b-0892-4248-b913-69719f29dff6.png)
HTML5:![grafik](https://user-images.githubusercontent.com/17685000/157554122-0f4533fc-44ad-42b7-8a82-1ae87c87b4dd.png)
The different positions of the rectangle are due to different timings when doing the screenshots, the example project is based on https://github.com/Kha-Samples/Shader-G2/ where the rectangle moves.
Execution Environment:
Kinc shows up as modified because Kha's Kinc version doesn't yet point to the latest master, the Khamake version has html5 devtools enabled upon startup. Other than that there are no changes.
Additional context Original issue: https://github.com/armory3d/armory/issues/2371