Made selection rays (it turned out 6 planes). it is now necessary to color out the triangles that are inside this truncated pyramid. How do you advise to do this? Tell me not the geometry, but exactly how to do it programmatically in the shader. enter image description here

  • Conceptually, you need to transfer the model to the frustum space (which is defined almost as a projection matrix) and select everything that will be in the unit cube. - Kromster pm
  • @Kromster I have such an idea first to add a texture to the model. and then send all the coordinates of this model to the shader and check it there - Sanaev
  • Texture you do not need. In the vertex shader, consider all transformations; in the fragment shader, specify the color depending on the calculated position of the fragment. - Kromster 5:09
  • @Kromster aa to do it in a shader not frustum, but in a model shader? - Sanaev
  • Do you have a mess, you missed a lot of steam? Shader model, naturally. - Kromster

0