Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

many_foxes are all black #6528

Closed
hymm opened this issue Nov 9, 2022 · 13 comments
Closed

many_foxes are all black #6528

hymm opened this issue Nov 9, 2022 · 13 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Milestone

Comments

@hymm
Copy link
Contributor

hymm commented Nov 9, 2022

Bevy version

1914a3f

Relevant system information

AdapterInfo { name: "AMD Radeon RX 6600", vendor: 4098, device: 29695, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "22.9.2", backend: Vulkan }

What you did

cargo run --release --example many_foxes

What went wrong

foxes should be orange with a texture, but render black.

image

@hymm hymm added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Nov 9, 2022
@hymm hymm added this to the Bevy 0.9 milestone Nov 9, 2022
@irate-devil
Copy link
Contributor

No issues on my end

AdapterInfo { name: "NVIDIA GeForce RTX 2070 SUPER", vendor: 4318, device: 7812, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "520.56.06", backend: Vulkan }

@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Nov 9, 2022
@DasLixou
Copy link
Contributor

DasLixou commented Nov 9, 2022

I also have a AMD Radeon RX 6600, I’ll check that tomorrow :)

@SecretPocketCat
Copy link
Contributor

Same on my RX590 on Win11
AdapterInfo { name: "Radeon RX 590 Series", vendor: 4098, device: 26591, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "22.3.1", backend: Vulkan }

Also the shadows are kinda broken in my case, which might be a seperate issue
image

@VitalyAnkh
Copy link
Contributor

Could you run with RUST_LOG=info cargo run --release --example many_foxes to see which texture format is in use in the terminal output, like this of mine:

2022-11-10T03:12:43.047254Z  INFO wgpu_core::device: Created render pipeline Valid((10, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("shadow_pipeline"), layout: Some((8, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (10, 1, Vulkan), entry_point: "vertex" }, buffers: [VertexBufferLayout { array_stride: 56, step_mode: Vertex, attributes: [VertexAttribute { format: Float32x3, offset: 0, shader_location: 0 }, VertexAttribute { format: Uint16x4, offset: 48, shader_location: 4 }, VertexAttribute { format: Float32x4, offset: 32, shader_location: 5 }] }] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: Some(DepthStencilState { format: Depth32Float, depth_write_enabled: true, depth_compare: GreaterEqual, stencil: StencilState { front: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, back: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, read_mask: 0, write_mask: 0 }, bias: DepthBiasState { constant: 0, slope_scale: 0.0, clamp: 0.0 } }), multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: None, multiview: None }    
2022-11-10T03:12:43.058678Z  INFO wgpu_core::device: Created buffer Valid((6, 2, Vulkan)) with BufferDescriptor { label: None, size: 4, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T03:12:43.058860Z  INFO wgpu_core::device: configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8Unorm, width: 2544, height: 1460, present_mode: AutoNoVsync, alpha_mode: Auto }    

@SecretPocketCat
Copy link
Contributor

Could you run with RUST_LOG=info cargo run --release --example many_foxes to see which texture format is in use in the terminal output, like this of mine:
_mode: Auto }

2022-11-10T06:55:16.025937Z  INFO wgpu_core::device: Created buffer Valid((12, 1, Vulkan)) with BufferDescriptor { label: None, size: 64, usage: COPY_DST | UNIFORM, mapped_at_creation: true }
2022-11-10T06:55:16.035772Z  INFO wgpu_core::device: configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 1600, height: 900, present_mode: AutoNoVsync, alpha_mode: Auto }
2022-11-10T06:55:16.046037Z  INFO wgpu_core::device: Automatically choosing presentation mode by rule AutoNoVsync. Chose Immediate    
2022-11-10T06:55:16.046332Z  INFO wgpu_core::device: Automatically choosing alpha mode by rule Auto. Chose Opaque
2022-11-10T06:55:16.057988Z  INFO wgpu_core::device: Created texture Valid((9, 1, Vulkan)) with TextureDescriptor { label: Some("main_texture_a"), size: Extent3d { width: 1600, height: 900, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: TEXTURE_BINDING | RENDER_ATTACHMENT }
2022-11-10T06:55:16.063618Z  INFO wgpu_core::device: Created render pipeline Valid((0, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("bloom_downsampling_prefilter_pipeline"), layout: Some((0, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (1, 1, Vulkan), entry_point: "downsample_prefilter" }, targets: [Some(ColorTargetState { format: Rgba16Float, blend: None, write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }

@greytdepression
Copy link
Contributor

I have the same issue on an Intel integrated GPU:
AdapterInfo { name: "Intel(R) Xe Graphics (TGL GT2)", vendor: 32902, device: 39497, device_type: IntegratedGpu, driver: "Intel open-source Mesa driver", driver_info: "Mesa 22.2.2", backend: Vulkan }
The shadows look correct for me and are placed properly, but I'm not sure if the gray bar in the upper part of the window is supposed to be there.
image

@DasLixou
Copy link
Contributor

grafik
Same result for me but at the back there are some color stripes. that looks more like an issue from lightning to me.

log:

2022-11-10T16:17:14.632808Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1    
2022-11-10T16:17:14.650161Z  INFO wgpu_hal::vulkan::instance: Unable to find extension: VK_EXT_swapchain_colorspace    
2022-11-10T16:17:14.654692Z  INFO wgpu_hal::vulkan::instance: Instance version: 0x4030e2    
2022-11-10T16:17:14.654716Z  INFO wgpu_hal::vulkan::instance: Enabling device properties2    
2022-11-10T16:17:14.661379Z  INFO wgpu_core::instance: Adapter Vulkan AdapterInfo { name: "AMD Radeon RX 6600 (RADV NAVI23)", vendor: 4098, device: 29695, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 22.2.2", backend: Vulkan }    
2022-11-10T16:17:14.661423Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 6600 (RADV NAVI23)", vendor: 4098, device: 29695, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 22.2.2", backend: Vulkan }
2022-11-10T16:17:14.682231Z  INFO wgpu_core::device: Created texture Valid((0, 1, Vulkan)) with TextureDescriptor { label: None, size: Extent3d { width: 1, height: 1, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: COPY_DST | TEXTURE_BINDING }    
2022-11-10T16:17:14.683534Z  INFO wgpu_core::device: Created texture Valid((1, 1, Vulkan)) with TextureDescriptor { label: None, size: Extent3d { width: 1, height: 1, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: COPY_DST | TEXTURE_BINDING }    
2022-11-10T16:17:14.683726Z  INFO wgpu_core::device: Created texture Valid((2, 1, Vulkan)) with TextureDescriptor { label: None, size: Extent3d { width: 1, height: 1, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: COPY_DST | TEXTURE_BINDING }    
2022-11-10T16:17:14.685644Z  INFO wgpu_core::device: Created texture Valid((3, 1, Vulkan)) with TextureDescriptor { label: None, size: Extent3d { width: 1, height: 1, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: COPY_DST | TEXTURE_BINDING }    
2022-11-10T16:17:14.779615Z  WARN many_foxes: This is a stress test used to push Bevy to its limit and debug performance issues. It is not representative of an actual game. It must be run in release mode using --release or it will be very slow.
2022-11-10T16:17:14.779644Z  INFO many_foxes: Spawning 1000 foxes...
Animation controls:
  - spacebar: play / pause
  - arrow up / down: speed up / slow down animation playback
  - arrow left / right: seek backward / forward
  - return: change animation
2022-11-10T16:17:14.783928Z  INFO wgpu_core::device: Created buffer Valid((0, 1, Vulkan)) with BufferDescriptor { label: None, size: 64, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.784041Z  INFO wgpu_core::device: Created texture Valid((4, 1, Vulkan)) with TextureDescriptor { label: Some("point_light_shadow_map_texture"), size: Extent3d { width: 1024, height: 1024, depth_or_array_layers: 6 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Depth32Float, usage: TEXTURE_BINDING | RENDER_ATTACHMENT }    
2022-11-10T16:17:14.784109Z  INFO wgpu_core::device: Created texture Valid((5, 1, Vulkan)) with TextureDescriptor { label: Some("directional_light_shadow_map_texture"), size: Extent3d { width: 4096, height: 4096, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Depth32Float, usage: TEXTURE_BINDING | RENDER_ATTACHMENT }    
2022-11-10T16:17:14.784139Z  INFO wgpu_core::device: Created buffer Valid((1, 1, Vulkan)) with BufferDescriptor { label: None, size: 1184, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.784238Z  INFO wgpu_core::device: Created texture Valid((6, 1, Vulkan)) with TextureDescriptor { label: None, size: Extent3d { width: 1, height: 1, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: COPY_DST | TEXTURE_BINDING }    
2022-11-10T16:17:14.784249Z  INFO wgpu_core::device: Created buffer Valid((2, 1, Vulkan)) with BufferDescriptor { label: None, size: 12, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.784447Z  INFO wgpu_core::device: configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 940, height: 1040, present_mode: AutoNoVsync, alpha_mode: Auto }    
2022-11-10T16:17:14.784326Z  INFO wgpu_core::device: Created buffer Valid((3, 1, Vulkan)) with BufferDescriptor { label: None, size: 4, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.784293Z  INFO wgpu_core::device: Created texture Valid((7, 1, Vulkan)) with TextureDescriptor { label: Some("view_depth_texture"), size: Extent3d { width: 940, height: 1040, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 4, dimension: D2, format: Depth32Float, usage: RENDER_ATTACHMENT }    
2022-11-10T16:17:14.784569Z  INFO wgpu_core::device: Created buffer Valid((4, 1, Vulkan)) with BufferDescriptor { label: None, size: 144, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.784689Z  INFO wgpu_core::device: Automatically choosing presentation mode by rule AutoNoVsync. Chose Immediate    
2022-11-10T16:17:14.784700Z  INFO wgpu_core::device: Automatically choosing alpha mode by rule Auto. Chose Opaque    
2022-11-10T16:17:14.786062Z  INFO wgpu_core::device: Created buffer Valid((5, 1, Vulkan)) with BufferDescriptor { label: None, size: 16384, usage: COPY_DST | UNIFORM, mapped_at_creation: false }    
2022-11-10T16:17:14.786093Z  INFO wgpu_core::device: Created buffer Valid((7, 1, Vulkan)) with BufferDescriptor { label: None, size: 59904, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.786132Z  INFO wgpu_core::device: Created buffer Valid((8, 1, Vulkan)) with BufferDescriptor { label: None, size: 64, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.786138Z  INFO wgpu_core::device: Created buffer Valid((6, 1, Vulkan)) with BufferDescriptor { label: None, size: 1440, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.786222Z  INFO wgpu_core::device: Created buffer Valid((9, 1, Vulkan)) with BufferDescriptor { label: Some("Mesh Vertex Buffer"), size: 128, usage: VERTEX, mapped_at_creation: true }    
2022-11-10T16:17:14.786596Z  INFO wgpu_core::device: Created texture Valid((9, 1, Vulkan)) with TextureDescriptor { label: Some("main_texture_a"), size: Extent3d { width: 940, height: 1040, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: TEXTURE_BINDING | RENDER_ATTACHMENT }    
2022-11-10T16:17:14.786607Z  INFO wgpu_core::device: Created buffer Valid((11, 1, Vulkan)) with BufferDescriptor { label: None, size: 64, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.786646Z  INFO wgpu_core::device: Created buffer Valid((10, 1, Vulkan)) with BufferDescriptor { label: None, size: 32, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.786680Z  INFO wgpu_core::device: Created texture Valid((10, 1, Vulkan)) with TextureDescriptor { label: Some("main_texture_b"), size: Extent3d { width: 940, height: 1040, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: TEXTURE_BINDING | RENDER_ATTACHMENT }    
2022-11-10T16:17:14.786684Z  INFO wgpu_core::device: Created buffer Valid((12, 1, Vulkan)) with BufferDescriptor { label: Some("Mesh Index Buffer"), size: 24, usage: INDEX, mapped_at_creation: true }    
2022-11-10T16:17:14.787020Z  INFO wgpu_core::device: Created texture Valid((11, 1, Vulkan)) with TextureDescriptor { label: Some("main_texture_sampled"), size: Extent3d { width: 940, height: 1040, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 4, dimension: D2, format: Rgba8UnormSrgb, usage: RENDER_ATTACHMENT }    
2022-11-10T16:17:14.791762Z  INFO wgpu_core::device: Created render pipeline Valid((0, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("bloom_upsampling_final_pipeline"), layout: Some((0, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (1, 1, Vulkan), entry_point: "upsample_final" }, targets: [Some(ColorTargetState { format: Rgba16Float, blend: Some(BlendState { color: BlendComponent { src_factor: One, dst_factor: One, operation: Add }, alpha: BlendComponent { src_factor: One, dst_factor: Zero, operation: Add } }), write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.792138Z  INFO wgpu_core::device: Created render pipeline Valid((1, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("upscaling pipeline"), layout: Some((1, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (2, 1, Vulkan), entry_point: "fs_main" }, targets: [Some(ColorTargetState { format: Bgra8UnormSrgb, blend: None, write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.792429Z  INFO wgpu_core::device: Created render pipeline Valid((2, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("bloom_downsampling_prefilter_pipeline"), layout: Some((0, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (1, 1, Vulkan), entry_point: "downsample_prefilter" }, targets: [Some(ColorTargetState { format: Rgba16Float, blend: None, write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.792701Z  INFO wgpu_core::device: Created render pipeline Valid((3, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("bloom_upsampling_pipeline"), layout: Some((2, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (1, 1, Vulkan), entry_point: "upsample" }, targets: [Some(ColorTargetState { format: Rgba16Float, blend: None, write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.793243Z  INFO wgpu_core::device: Created render pipeline Valid((4, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("ui_pipeline"), layout: Some((3, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (3, 1, Vulkan), entry_point: "vertex" }, buffers: [VertexBufferLayout { array_stride: 36, step_mode: Vertex, attributes: [VertexAttribute { format: Float32x3, offset: 0, shader_location: 0 }, VertexAttribute { format: Float32x2, offset: 12, shader_location: 1 }, VertexAttribute { format: Float32x4, offset: 20, shader_location: 2 }] }] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (3, 1, Vulkan), entry_point: "fragment" }, targets: [Some(ColorTargetState { format: Rgba8UnormSrgb, blend: Some(BlendState { color: BlendComponent { src_factor: SrcAlpha, dst_factor: OneMinusSrcAlpha, operation: Add }, alpha: BlendComponent { src_factor: One, dst_factor: OneMinusSrcAlpha, operation: Add } }), write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.794362Z  INFO wgpu_core::device: Created render pipeline Valid((5, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("shadow_pipeline"), layout: Some((4, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (4, 1, Vulkan), entry_point: "vertex" }, buffers: [VertexBufferLayout { array_stride: 32, step_mode: Vertex, attributes: [VertexAttribute { format: Float32x3, offset: 0, shader_location: 0 }] }] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: Some(DepthStencilState { format: Depth32Float, depth_write_enabled: true, depth_compare: GreaterEqual, stencil: StencilState { front: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, back: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, read_mask: 0, write_mask: 0 }, bias: DepthBiasState { constant: 0, slope_scale: 0.0, clamp: 0.0 } }), multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: None, multiview: None }    
2022-11-10T16:17:14.794677Z  INFO wgpu_core::device: Created render pipeline Valid((6, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("bloom_downsampling_pipeline"), layout: Some((0, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (1, 1, Vulkan), entry_point: "downsample" }, targets: [Some(ColorTargetState { format: Rgba16Float, blend: None, write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.795262Z  INFO wgpu_core::device: Created render pipeline Valid((7, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("tonemapping pipeline"), layout: Some((5, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (0, 1, Vulkan), entry_point: "fullscreen_vertex_shader" }, buffers: [] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: None, multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (5, 1, Vulkan), entry_point: "fragment" }, targets: [Some(ColorTargetState { format: Rgba16Float, blend: None, write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.802376Z  INFO wgpu_core::device: Created render pipeline Valid((8, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("pbr_opaque_mesh_pipeline"), layout: Some((6, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (6, 1, Vulkan), entry_point: "vertex" }, buffers: [VertexBufferLayout { array_stride: 32, step_mode: Vertex, attributes: [VertexAttribute { format: Float32x3, offset: 0, shader_location: 0 }, VertexAttribute { format: Float32x3, offset: 12, shader_location: 1 }, VertexAttribute { format: Float32x2, offset: 24, shader_location: 2 }] }] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: Some(Back), unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: Some(DepthStencilState { format: Depth32Float, depth_write_enabled: true, depth_compare: Greater, stencil: StencilState { front: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, back: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, read_mask: 0, write_mask: 0 }, bias: DepthBiasState { constant: 0, slope_scale: 0.0, clamp: 0.0 } }), multisample: MultisampleState { count: 4, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (7, 1, Vulkan), entry_point: "fragment" }, targets: [Some(ColorTargetState { format: Rgba8UnormSrgb, blend: Some(BlendState { color: BlendComponent { src_factor: One, dst_factor: Zero, operation: Add }, alpha: BlendComponent { src_factor: One, dst_factor: Zero, operation: Add } }), write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.922067Z  INFO wgpu_core::device: Created texture Valid((12, 1, Vulkan)) with TextureDescriptor { label: None, size: Extent3d { width: 1024, height: 1024, depth_or_array_layers: 1 }, mip_level_count: 1, sample_count: 1, dimension: D2, format: Rgba8UnormSrgb, usage: COPY_DST | TEXTURE_BINDING }    
2022-11-10T16:17:14.923332Z  INFO wgpu_core::device: Created buffer Valid((14, 1, Vulkan)) with BufferDescriptor { label: None, size: 4, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.923325Z  INFO wgpu_core::device: Created buffer Valid((13, 1, Vulkan)) with BufferDescriptor { label: None, size: 1550848, usage: COPY_DST | UNIFORM, mapped_at_creation: false }    
2022-11-10T16:17:14.923382Z  INFO wgpu_core::device: Created buffer Valid((15, 1, Vulkan)) with BufferDescriptor { label: None, size: 256144, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.923546Z  INFO wgpu_core::device: Created buffer Valid((16, 1, Vulkan)) with BufferDescriptor { label: None, size: 59904, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.923906Z  INFO wgpu_core::device: Created buffer Valid((17, 1, Vulkan)) with BufferDescriptor { label: None, size: 64, usage: COPY_DST | UNIFORM, mapped_at_creation: true }    
2022-11-10T16:17:14.924031Z  INFO wgpu_core::device: Created buffer Valid((18, 1, Vulkan)) with BufferDescriptor { label: Some("Mesh Vertex Buffer"), size: 96768, usage: VERTEX, mapped_at_creation: true }    
2022-11-10T16:17:14.927234Z  INFO naga::back::spv::writer: Skip function Some("mesh_normal_local_to_world")    
2022-11-10T16:17:14.927253Z  INFO naga::back::spv::writer: Skip function Some("sign_determinant_model_3x3")    
2022-11-10T16:17:14.927259Z  INFO naga::back::spv::writer: Skip function Some("mesh_tangent_local_to_world")    
2022-11-10T16:17:14.927399Z  INFO wgpu_core::device: Created render pipeline Valid((9, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("shadow_pipeline"), layout: Some((7, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (8, 1, Vulkan), entry_point: "vertex" }, buffers: [VertexBufferLayout { array_stride: 56, step_mode: Vertex, attributes: [VertexAttribute { format: Float32x3, offset: 0, shader_location: 0 }, VertexAttribute { format: Uint16x4, offset: 48, shader_location: 4 }, VertexAttribute { format: Float32x4, offset: 32, shader_location: 5 }] }] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: None, unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: Some(DepthStencilState { format: Depth32Float, depth_write_enabled: true, depth_compare: GreaterEqual, stencil: StencilState { front: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, back: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, read_mask: 0, write_mask: 0 }, bias: DepthBiasState { constant: 0, slope_scale: 0.0, clamp: 0.0 } }), multisample: MultisampleState { count: 1, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: None, multiview: None }    
2022-11-10T16:17:14.933240Z  INFO naga::back::spv::writer: Skip function Some("mesh_normal_local_to_world")    
2022-11-10T16:17:14.933265Z  INFO naga::back::spv::writer: Skip function Some("sign_determinant_model_3x3")    
2022-11-10T16:17:14.933273Z  INFO naga::back::spv::writer: Skip function Some("mesh_tangent_local_to_world")    
2022-11-10T16:17:14.933402Z  INFO naga::back::spv::writer: Skip function Some("skin_model")    
2022-11-10T16:17:14.934162Z  INFO wgpu_core::device: Created render pipeline Valid((10, 1, Vulkan)) with RenderPipelineDescriptor { label: Some("pbr_opaque_mesh_pipeline"), layout: Some((8, 1, Vulkan)), vertex: VertexState { stage: ProgrammableStageDescriptor { module: (9, 1, Vulkan), entry_point: "vertex" }, buffers: [VertexBufferLayout { array_stride: 56, step_mode: Vertex, attributes: [VertexAttribute { format: Float32x3, offset: 0, shader_location: 0 }, VertexAttribute { format: Float32x3, offset: 12, shader_location: 1 }, VertexAttribute { format: Float32x2, offset: 24, shader_location: 2 }, VertexAttribute { format: Uint16x4, offset: 48, shader_location: 5 }, VertexAttribute { format: Float32x4, offset: 32, shader_location: 6 }] }] }, primitive: PrimitiveState { topology: TriangleList, strip_index_format: None, front_face: Ccw, cull_mode: Some(Back), unclipped_depth: false, polygon_mode: Fill, conservative: false }, depth_stencil: Some(DepthStencilState { format: Depth32Float, depth_write_enabled: true, depth_compare: Greater, stencil: StencilState { front: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, back: StencilFaceState { compare: Always, fail_op: Keep, depth_fail_op: Keep, pass_op: Keep }, read_mask: 0, write_mask: 0 }, bias: DepthBiasState { constant: 0, slope_scale: 0.0, clamp: 0.0 } }), multisample: MultisampleState { count: 4, mask: 18446744073709551615, alpha_to_coverage_enabled: false }, fragment: Some(FragmentState { stage: ProgrammableStageDescriptor { module: (10, 1, Vulkan), entry_point: "fragment" }, targets: [Some(ColorTargetState { format: Rgba8UnormSrgb, blend: Some(BlendState { color: BlendComponent { src_factor: One, dst_factor: Zero, operation: Add }, alpha: BlendComponent { src_factor: One, dst_factor: Zero, operation: Add } }), write_mask: RED | GREEN | BLUE | ALPHA | COLOR | ALL })] }), multiview: None }    
2022-11-10T16:17:14.952922Z  INFO wgpu_core::device: Created buffer Valid((4, 2, Vulkan)) with BufferDescriptor { label: None, size: 4, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.953076Z  INFO wgpu_core::device: Created buffer Valid((5, 2, Vulkan)) with BufferDescriptor { label: None, size: 59904, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.972234Z  INFO wgpu_core::device: Created buffer Valid((16, 2, Vulkan)) with BufferDescriptor { label: None, size: 4, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.972417Z  INFO wgpu_core::device: Created buffer Valid((14, 2, Vulkan)) with BufferDescriptor { label: None, size: 59904, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.992110Z  INFO wgpu_core::device: Created buffer Valid((5, 3, Vulkan)) with BufferDescriptor { label: None, size: 4, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.992227Z  INFO wgpu_core::device: Created buffer Valid((4, 3, Vulkan)) with BufferDescriptor { label: None, size: 59904, usage: COPY_DST | STORAGE, mapped_at_creation: true }    
2022-11-10T16:17:14.998674Z  INFO wgpu_core::hub: Dropping Global    
2022-11-10T16:17:15.000027Z  INFO wgpu_core::device: Destroying 2 command encoders

@greytdepression
Copy link
Contributor

Yes, the issue is caused by the directional light (as @DasLixou suspected). Here is how the scene looks for me with the light removed
Screenshot from 2022-11-10 17-58-07

@DasLixou
Copy link
Contributor

oh. so its a problem with directional light that only gets caused on some graphic drivers?

@greytdepression
Copy link
Contributor

That's not what broke it for me. I ran a git bisect on it and the breaking commit is 681c9c6.

greytdepression referenced this issue Nov 10, 2022
# Objective

- Morten Mikkelsen clarified that the world normal and tangent must be normalized in the vertex stage and the interpolated values must not be normalized in the fragment stage. This is in order to match the mikktspace approach exactly.
- Fixes #5514 by ensuring the tangent basis matrix (TBN) is orthonormal

## Solution

- Normalize the world normal in the vertex stage and not the fragment stage
- Normalize the world tangent xyz in the vertex stage
- Take into account the sign of the determinant of the local to world matrix when calculating the bitangent

---

## Changelog

- Fixed - scaling a model that uses normal mapping now has correct lighting again
@greytdepression
Copy link
Contributor

I'll open a PR for it, but as the comment states, there is a reason the algorithm does not want this vector to be normalized. So I don't know what the proper way to fix this is.

@superdump
Copy link
Contributor

Could you test this: #6543?

@SecretPocketCat
Copy link
Contributor

SecretPocketCat commented Nov 10, 2022

Could you test this: #6543?

Looks good on my RX590.

@bors bors bot closed this as completed in c4e791d Nov 11, 2022
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Make the many foxes not unnecessarily bright. Broken since bevyengine#5666.
- Fixes bevyengine#6528 

## Solution

- In bevyengine#5666 normalisation of normals was moved from the fragment stage to the vertex stage. However, it was not added to the vertex stage for skinned normals. The many foxes are skinned and their skinned normals were not unit normals. which made them brighter. Normalising the skinned normals fixes this.

---

## Changelog

- Fixed: Non-unit length skinned normals are now normalized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Projects
None yet
8 participants