MeshBufferCache MeshbatchCache用途

占位

void DRW_shgroup_add_material_resources(DRWShadingGroup *grp, struct GPUMaterial *material)
{
  ListBase textures = GPU_material_textures(material);

  /* Bind all textures needed by the material. */
  LISTBASE_FOREACH (GPUMaterialTexture *, tex, &textures) {
    if (tex->ima) {
      /* Image */
      GPUTexture *gputex;
      if (tex->tiled_mapping_name[0]) {
        gputex = BKE_image_get_gpu_tiles(tex->ima, tex->iuser, NULL);
        drw_shgroup_material_texture(grp, gputex, tex->sampler_name, tex->sampler_state);
        gputex = BKE_image_get_gpu_tilemap(tex->ima, tex->iuser, NULL);
        drw_shgroup_material_texture(grp, gputex, tex->tiled_mapping_name, tex->sampler_state);
      }
      else {
        gputex = BKE_image_get_gpu_texture(tex->ima, tex->iuser, NULL);
        drw_shgroup_material_texture(grp, gputex, tex->sampler_name, tex->sampler_state);
      }
    }
    else if (tex->colorband) {
      /* Color Ramp */
      DRW_shgroup_uniform_texture(grp, tex->sampler_name, *tex->colorband);
    }
  }
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容