Skip to content

Can we change background color? #81

Answered by fbxiang
keiohta asked this question in Q&A
Discussion options

You must be logged in to vote

You can customize the shader following these steps:

  1. make a copy of the vulkan_shader folder
  2. pick the shader pack you want to use (I believe the default is the ibl)
  3. Modify the background color used in deferred.frag (this line:
    outLighting = vec4(getBackgroundColor((cameraBuffer.viewMatrixInverse * csPosition).xyz), 1.f);
    ) For example, change it to outLighting=vec4(1,1,1,0)
  4. call sapien.VulkanRenderer.set_viewer_shader_dir and/or sapien.VulkanRenderer.set_camera_shader_dir before creating the viewer or the camera. Give it the directory of the modified ibl folder.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@keiohta
Comment options

@fbxiang
Comment options

Answer selected by keiohta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants