How to create a BasicEffect - Errors in Vulkan / OpenGL renderers
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- csharp, github
- Lĩnh vực
- documentation
Hướng nghiên cứu
Start with the linked Basic Effect guide and reproduce the issue using the linked BasicEffectFromEmptyGame project, running its DesktopVK and DesktopGL projects as described. Compare the guide’s example with the error and black triangle reported across the two renderers; done means the documented example runs without the Vulkan crash and displays the vertex colors in OpenGL.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
While trying to follow the How to create a Basic Effect guide, starting from the new Empty Game template, running the Platforms.DesktopVK project ended up crashing with the following error:
Unhandled exception. System.InvalidOperationException: An error occurred while preparing to draw. This is probably because the current vertex declaration does not include all the elements required by the current vertex shader. The current vertex declaration includes these elements: POSITION0, NORMAL0, COLOR0.
$(String[] args) in /home/sylvain/Programmes/Jeux/DungeonCrawlerTest (Copie)/Platforms/DesktopVK/Program.cs:line 4
at Microsoft.Xna.Framework.Graphics.VertexInputLayout.GenerateInputElements(VertexAttribute[] inputs, MGG_InputElement[]& elements, Int32[]& strides)
at Microsoft.Xna.Framework.Graphics.Shader.GetOrCreateLayout(VertexBufferBindings vertexBuffers)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformApplyState(Boolean applyShaders)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserPrimitives[T](PrimitiveType primitiveType, T[] vertexData, Int32 vertexOffset, Int32 primitiveCount, VertexDeclaration vertexDeclaration)
at BasicEffectFromEmptyGame.Game1.Draw(GameTime gameTime) in /home/sylvain/Programmes/Jeux/DungeonCrawlerTest (Copie)/Source/Game1.cs:line 99
at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.NativeGamePlatform.RunLoop()
at Program.
The same code when running the Platforms.DesktopGL project doesn't crash, but prints a black triangle (it should have been vertex colored):
I couldn't test the Platforms.DirectX12 build working on a Linux environment with the following specs:
- OS: Ubuntu 24.04.5 LTS (64-bit)
- GNOME version: 46
- windowing system: X11
- kernel version: Linux 7.0.0-43-generic
How to reproduce?
- Clone the reproduction repository: [https://github.com/raaaahman/BasicEffectFromEmptyGame][https://github.com/raaaahman/BasicEffectFromEmptyGame)
- Run
dotnet run --project Platforms/DesktopVK/BasicEffectFromEmptyGame.DesktopVK.csprojanddotnet run --project Platforms/DesktopGL/BasicEffectFromEmptyGame.DesktopGL.csproj - Optional. Comment Game1.cs: line 44 and run the projects again. Notice this doesn't change the issue.
- Ngôn ngữ chính
- C#
- Star
- 20
- Fork
- 97
- Merge trung bình
- 8 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MonoGame/docs.monogame.github.io
-
Docs typoĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
MonoGame/docs.monogame.github.io#328 · 1 bình luận ·
-
URGENT! Update documentation on how to install Wine on MacOSCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
MonoGame/docs.monogame.github.io#308 · 1 bình luận ·
-
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
MonoGame/docs.monogame.github.io#263 · 3 bình luận ·
Tất cả issue của MonoGame/docs.monogame.github.io
Issue tương tự
-
type:task ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
elsa-workflows/elsa-foundation#5253 ·
Maintainer thường phản hồi trong vòng 1 ngày