RenderDoc导出纹理时只能一张张导出,非常麻烦,改一下RenderDoc,效果如下
一、qrenderdoc\Windows\TextureViewer.ui中追加2个按钮
<item>
<widget class="QToolButton" name="saveTex">
<property name="toolTip">
<string>Save selected Texture</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/save.png</normaloff>:/save.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
// 追加以下代码
<widget class="QToolButton" name="saveTexs">
<property name="toolTip">
<string>Batch Save Textures => d:\\capture\\ </string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/save2.png</normaloff>:/save2.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="saveAllTex">
<property name="toolTip">
<string>Save all Textures => d:\\capture\\ </string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../Resources/resources.qrc">
<normaloff>:/save3.png</normaloff>:/save3.png</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
二、qrenderdoc/Code/Resources.h中追加2个图标
RESOURCE_DEF(save, "save.png") \
RESOURCE_DEF(save2, "save2.png") \
RESOURCE_DEF(save3, "save3.png") \
三、qrenderdoc/Resources/目录中添加几个新图标,save2.png, [email protected], save3.png, [email protected]
四、qrenderdoc/Resources/resources.qrc中追加2个图标
<file>save.png</file>
<file>save2.png</file>
<file>save3.png</file>
五、在qrenderdoc/Windows/TextureViewer.cpp中追加代码
static TextureSave tmpSaveCfg;
void TextureViewer::SaveStageResourcePreviews(ShaderStage stage,
const rdcarray<ShaderResource> &resourceDetails,
const rdcarray<Bindpoint> &mapping,
rdcarray<BoundResourceArray> &ResList,
int &prevIndex, bool copy,
bool rw, const QString& savePath)
{
for(int idx=0; idx < mapping.count(); idx++)
{
const Bindpoint &key = mapping[idx];
const rdcarray<BoundResource> *resArray = NULL;
uint32_t dynamicallyUsedResCount = 1;
int32_t firstIndex = 0;
int residx = ResList.indexOf(key);
if(residx >= 0)
{
resArray = &ResList[residx].resources;
dynamicallyUsedResCount = ResList[residx].dynamicallyUsedCount;
firstIndex = ResList[residx].firstIndex;
}
int arrayLen = resArray != NULL ? resArray->count() : 1;
const bool collapseArray = arrayLen > 8 && (dynamicallyUsedResCount > 20 || m_ShowUnused);
for(int i = 0; i < arrayLen; i++)
{
int arrayIdx = firstIndex + i;
if(resArray && i >= resArray->count())
break;
if(resArray && !resArray->at(i).dynamicallyUsed)
continue;
BoundResource res = {};
if(resArray)
res = resArray->at(i);
Following follow(*this, rw ? FollowType::ReadWrite : FollowType::ReadOnly, stage, idx,
arrayIdx);
// show if it's referenced by the shader - regardless of empty or not
bool show = key.used || copy;
// it's bound, but not referenced, and we have "show disabled"
show = show || (m_ShowUnused && res.resourceId != ResourceId());
// it's empty, and we have "show empty"
show = show || (m_ShowEmpty && res.resourceId == ResourceId());
// it's the one we're following
show = show || (follow == m_Following);
if(!show)
{
continue;
}
tmpSaveCfg.resourceId = res.resourceId;
tmpSaveCfg.destType = FileType::TGA;
tmpSaveCfg.channelExtract = -1;
tmpSaveCfg.alphaCol = FloatVector(0, 0, 0, 0);
uint64_t currId = *((uint64_t*)&res.resourceId);
QString fn = QString(tr("%1\\%2.tga")).arg(savePath).arg(currId);
bool ret = false;
m_Ctx.Replay().BlockInvoke([this, &ret, fn](IReplayController *r)
{
ret = r->SaveTexture(tmpSaveCfg, fn.toUtf8().data());
});
}
}
}
static uint captureBatch = 0;
void TextureViewer::on_saveTexs_clicked()
{
int outIndex = 0;
int inIndex = 0;
bool copy = false, clear = false, compute = false;
Following::GetDrawContext(m_Ctx, copy, clear, compute);
ShaderStage stages[] = {ShaderStage::Vertex, ShaderStage::Hull, ShaderStage::Domain,
ShaderStage::Geometry, ShaderStage::Pixel};
int count = 5;
if(compute)
{
stages[0] = ShaderStage::Compute;
count = 1;
}
const rdcarray<ShaderResource> empty;
QString currDir;
for(int i = 0; i < 2048; ++i)
{
++captureBatch;
currDir = QString(tr("d:\\capture\\cap_%1")).arg(captureBatch);
QDir dir(currDir);
if(dir.exists())
{
continue;
}
dir.mkpath(currDir);
break;
}
// display resources used for all stages
for(int i = 0; i < count; i++)
{
ShaderStage stage = stages[i];
m_ReadWriteResources[(uint32_t)stage] =
Following::GetReadWriteResources(m_Ctx, stage, !m_ShowUnused);
m_ReadOnlyResources[(uint32_t)stage] =
Following::GetReadOnlyResources(m_Ctx, stage, !m_ShowUnused);
const ShaderReflection *details = Following::GetReflection(m_Ctx, stage);
const ShaderBindpointMapping &mapping = Following::GetMapping(m_Ctx, stage);
SaveStageResourcePreviews(stage, details != NULL ? details->readOnlyResources : empty,
mapping.readOnlyResources, m_ReadOnlyResources[(uint32_t)stage],
inIndex, copy, false, currDir);
}
}
void TextureViewer::on_saveAllTex_clicked()
{
for(const TextureDescription &tex : m_Ctx.GetTextures())
{
tmpSaveCfg.resourceId = tex.resourceId;
tmpSaveCfg.destType = FileType::TGA;
tmpSaveCfg.channelExtract = -1;
tmpSaveCfg.alphaCol = FloatVector(0, 0, 0, 0);
QString fn;
fn.sprintf("d:\\capture\\%d.tga", tex.resourceId);
QFileInfo qi(fn);
QDir dir(qi.absoluteDir());
if (!dir.exists())
{
dir.makeAbsolute();
}
bool ret = false;
m_Ctx.Replay().BlockInvoke([this, &ret, fn](IReplayController *r) {
ret = r->SaveTexture(tmpSaveCfg, fn.toUtf8().data());
});
}
}
然后头文件中追加
void on_saveTexs_clicked();
void on_saveAllTex_clicked();
void SaveStageResourcePreviews(ShaderStage stage, const rdcarray &resourceDetails, const rdcarray &mapping, rdcarray &ResList, int &prevIndex, bool copy, bool rw, const QString& savePath);
然后构建后,点黄色按钮可批量导出纹理到 d:\capture\cap_XXX 目录中
点紫色按钮可导出所有纹理到 d:\capture\目录中
也不会弹出对话框了,实乃挖图利器
--转载请注明: http://blog.coolcoding.cn/?p=2750
文章浏览阅读936次。1 kmeansK-means聚类算法也称k均值聚类算法,是集简单和经典于一身的基于距离的聚类算法。它采用距离作为相似性的评价指标,即认为两个对象的距离越近,其相似度就越大。该算法认为类簇是由距离靠近的对象组成的,因此把得到紧凑且独立的簇作为最终目标。2.算法核心思想K-means聚类算法是一种迭代求解的聚类分析算法,其步骤是随机选取K个对象作为初始的聚类中心,然后计算每个对象与各个种子聚类中心之间的距离,把每个对象分配给距离它最近的聚类中心。聚类中心以及分配给它们的对象就代表一个聚类。每分配一个样本_kmeans算法相关性分析
文章浏览阅读466次,点赞8次,收藏12次。以上是基于Spring Boot的自习室管理系统的主要功能,通过这些功能可以实现自习室座位的管理、课程的管理、学员信息的管理和行为管理等功能,为自习室提供一个高效、便捷、智能的解决方案。登录后,系统将根据用户的角色显示相应的功能菜单。通过以上各个功能模块的实现,基于Spring Boot的自习室管理系统将提供一套完善的解决方案,帮助自习室提高工作效率和服务质量,为学员提供更加便捷、舒适的学习环境。通过生成相应的报表,管理员可以更好地了解自习室的使用状况和学员的学习情况,从而做出相应的决策和管理调整。_基于springboot的共享自习室管理系统参考文献
文章浏览阅读4.5k次,点赞7次,收藏26次。在进行深度学习过程中会遇到几个模型进行串联,这几个模型需要使用同一个优化器,但每个模型的学习率或者动量等其他参数不一样这种情况。一种解决方法是新建一个模型将这几个模型进行串联,另一种解决方法便是往优化器里面传入这几个模型的参数。..._pytorch加载多个模型
文章浏览阅读1.4k次。原标题:中级软考多少分及格盛泰鼎盛 对于第一次报名软考的朋友,可能对于考试合格分数线不太了解,软考分为初、中、高三个级别,那么软考中级多少分及格呢?软考中级合格标准根据往年的软考合格分数线来看,各级别的合格标准基本上统一的。2019年上半年计算机技术与软件专业技术资格(水平)考试各级别各专业各科目合格标准均为45分(总分75分)。而2016下半年计算机技术与软件专业技术资格(水平)考试除了信息系统..._计算机程序设计员中级考试内容及合格标准
文章浏览阅读50次。2019独角兽企业重金招聘Python工程师标准>>> ..._爬虫考虑安全法律因素
文章浏览阅读263次。本章主要内容有: ● 实现基于微软账户的第三方身份验证 ● 实现双因子身份验证 ● 验证码机制实现基于微软账户的第三方身份验证 在微软提供的ASP.NET MVC模板代码中,默认添加了微软、Google、twitter以及Facebook的账户登录代码(虽然被注释了),另外针对国内的一些社交账户提供了相应的组件,所有组件都可以通过Nuget包管理器安装: 从..._identity 二次登录
文章浏览阅读350次。首先要解决的问题是敏感词的存储形式,这就涉及数据结构,先想想搜索屏蔽要怎么处理,比如我有一个content,我就遍历它每个字符,先看与词典中所有词第一个字符相同的,再看第二个,再看第三个.等等。那么,很明显,这就需要一种以层来存储的数据结构--树来存储敏感词汇。我首先设计了一个Node,它要存储同一级的node指针,下一级的node指针,标识词的结束,数据。最开始本来只想到用树的结构,最后发现, ...
文章浏览阅读167次,点赞3次,收藏7次。1. 背景介绍1.1 隐私保护的重要性在当今的数字时代,个人隐私保护已经成为一个越来越受关注的问题。随着大数据和人工智能技术的快速发展,海量的个人数据被收集和利用,这给个人隐私带来了巨大的风险。如何在利用数据的同时保护个人隐私,已经成为了一个亟待解决的挑战。
文章浏览阅读177次。1.clone方法保护方法,实现对象的浅复制,只有实现了Cloneable接口才可以调用该方法,否则抛出CloneNotSupportedException异常。2.getClass方法final方法,获得运行时类型。3.toString方法该方法用得比较多,一般子类都有覆盖。4.finalize方法该方法用于释放资源。因为无法确定该方法什么时候被调用,很少使用。5.equals方法该方法是非常重..._一般情况下,异常类存放在什么包中
文章浏览阅读1.1k次。队列的定义队列简称为“对”,英文名为“Queue”。队列和堆栈一样都是特殊的线性表。和堆栈不一样的是,队列这种线性表的特殊是它限定只能在表的一端作插入运算,然后只能在表的另一端作删除运算,作插入元素的这一端为“队首”,作删除运算的这一端称为“队尾”。队列的这一特征我们又可以称它为“先进先出”。队列的这个“先进先出”就如同我们平时排队一样,讲究一个先来后到,先来的排在前面,后到的排在后面,排前面的先走,排后面的后走。队列有两种存储结构,一种是顺序排列,另一种是链式排列。如下面图的采用顺序存储结构_队列又可以简称为
文章浏览阅读867次,点赞11次,收藏20次。1.背景介绍在当今的数字时代,数据已经成为企业和组织中最宝贵的资产之一。随着数据的增长和复杂性,数据驱动的决策变得越来越重要。数据驱动的产品研发是一种新兴的方法,它利用数据来优化产品的设计、开发和运营。这种方法可以帮助企业更有效地利用数据,提高产品的安全性和质量。在这篇文章中,我们将探讨数据驱动的产品研发的核心概念、算法原理、实例和未来发展趋势。我们将涉及到以下几个方面:背景介绍核...
文章浏览阅读1.3k次。转载自:http://blog.sina.com.cn/s/blog_48b82df90100bpfj.html基础类的DSP/BIOS API调用一、时钟管理CLK(1)Uns ncounts = CLK_countspms(void) 返回每毫秒的定时器高分辨率时钟的计数值(2)LgUns currtime = CLK_gethtime(void) _clk_gethtime 返回值