当前位置: 首页 > news >正文

购物网站系统建设方案沈阳市浑南区城乡建设局网站

购物网站系统建设方案,沈阳市浑南区城乡建设局网站,资源平台,绑定网站域名怎么做期待结果#xff1a; 流程 1. 通过C写入数据到纹理贴图 2. 在材质中通过采样能正确读取写入的数值 踩坑#xff1a; 1. UE5之后#xff0c;需要设置采样类型#xff0c;才能达到上图效果#xff0c;默认采样类型做了插值计算 FColor中写入 PF_B8G8R8A8 UTexture2D* Conve…期待结果 流程 1. 通过C写入数据到纹理贴图 2. 在材质中通过采样能正确读取写入的数值 踩坑 1. UE5之后需要设置采样类型才能达到上图效果默认采样类型做了插值计算 FColor中写入 PF_B8G8R8A8 UTexture2D* ConvertFloatArr2Texture(TArrayFVector inFArr) {if (inFArr.IsEmpty()) return nullptr;//FlushRenderingCommands();uint32 len inFArr.Num();float templen FMath::Sqrt(len);uint32 text_len FMath::CeilToInt(templen);text_len FMath::CeilToInt(log2(text_len));text_len FMath::Pow(2, text_len);uint32 Totallen FMath::Pow(text_len, 2);FColor* datas new FColor[Totallen];for (uint32 i 0; i Totallen;i) {if (i len) {FColor Tempcolor;Tempcolor.B inFArr[i].X;Tempcolor.G inFArr[i].Y;Tempcolor.R inFArr[i].Z;Tempcolor.A 255;datas[i] Tempcolor;}else {FColor Tempcolor(0,0,0,1);datas[i] Tempcolor;}}UTexture2D* temp UTexture2D::CreateTransient(text_len, text_len, PF_B8G8R8A8);temp-Filter TF_Nearest;void* TextureData temp-GetPlatformData()-Mips[0].BulkData.Lock(LOCK_READ_WRITE);FPlatformMemory::Memcpy(TextureData, datas, Totallen * sizeof(uint8)*4);temp-GetPlatformData()-Mips[0].BulkData.Unlock();temp-UpdateResource();return temp; }FFloat16数据写入PF_FloatRGBA void ConvertFloatArr2Texture(TArrayfloat inFArr, int width, int height) {if (inFArr.IsEmpty()) return;FFloat16* datas new FFloat16[height * width * 4];for (auto it 0; it 256; it) {FFloat16 ff(inFArr[it]);datas[it] ff;}UTexture2D* temp UTexture2D::CreateTransient(width, height, PF_FloatRGBA);temp-Filter TF_Nearest;//temp-MipGenSettings TextureMipGenSettings::TMGS_NoMipmaps;//temp-CompressionSettings TextureCompressionSettings::TC_VectorDisplacementmap;void* TextureData temp-GetPlatformData()-Mips[0].BulkData.Lock(LOCK_READ_WRITE);FMemory::Memmove(TextureData, datas, height * width * 4 * sizeof(FFloat16));temp-GetPlatformData()-Mips[0].BulkData.Unlock();// 更新纹理数据temp-UpdateResource();} 将FFloat32写入PF_R32G32B32F类型贴图 UTexture2D* ConvertFloatArr2Texture(TArrayFVector inFArr) {if (inFArr.IsEmpty()) return nullptr;//FlushRenderingCommands();uint32 len inFArr.Num();float templen FMath::Sqrt(len);uint32 text_len FMath::CeilToInt(templen);text_len FMath::CeilToInt(log2(text_len));text_len FMath::Pow(2, text_len);uint32 Totallen FMath::Pow(text_len, 2);FFloat32* datas new FFloat32[Totallen*4];for (uint32 i 0; i Totallen;i) {if (i len) {datas[i * 3 0] inFArr[i].X;datas[i * 3 1] inFArr[i].Y;datas[i * 3 2] inFArr[i].Z;}else {datas[i * 4 0] 0.0f;datas[i * 4 1] 0.0f;datas[i * 4 2] 0.0f;}}UTexture2D* temp UTexture2D::CreateTransient(text_len, text_len, PF_R32G32B32F);temp-Filter TF_Nearest;void* TextureData temp-GetPlatformData()-Mips[0].BulkData.Lock(LOCK_READ_WRITE);FPlatformMemory::Memcpy(TextureData, datas, Totallen * sizeof(FFloat32)*3);temp-GetPlatformData()-Mips[0].BulkData.Unlock();temp-UpdateResource();return temp; } 写入FLinearColor到PF_A32B32G32R32F格式的贴图 UTexture2D* ConvertFloatArr2Texture(TArrayFVector inFArr) {if (inFArr.IsEmpty()) return nullptr;//FlushRenderingCommands();uint32 len inFArr.Num();float templen FMath::Sqrt(len);uint32 text_len FMath::CeilToInt(templen);text_len FMath::CeilToInt(log2(text_len));text_len FMath::Pow(2, text_len);uint32 Totallen FMath::Pow(text_len, 2);FLinearColor* datas new FLinearColor[Totallen];for (uint32 i 0; i Totallen;i) {if (i len) {datas[i].R inFArr[i].X;datas[i].G inFArr[i].Y;datas[i].B inFArr[i].Z;datas[i].A 1.0;}else {datas[i].R 0.0;datas[i].G 0.0;datas[i].B 0.0;datas[i].A 1.0;}}UTexture2D* temp UTexture2D::CreateTransient(text_len, text_len, PF_A32B32G32R32F);temp-Filter TF_Nearest;void* TextureData temp-GetPlatformData()-Mips[0].BulkData.Lock(LOCK_READ_WRITE);FPlatformMemory::Memcpy(TextureData, datas, Totallen * sizeof(FLinearColor));temp-GetPlatformData()-Mips[0].BulkData.Unlock();temp-UpdateResource();return temp; } FFloat16数据写入灰度图PF_R16F UTexture2D* ConvertFloatArr2Gray(TArrayFFloat16 inFArr, int32 width, int32 height) {if (inFArr.IsEmpty()) return nullptr;UTexture2D* temp UTexture2D::CreateTransient(width, height, PF_R16F);temp-MipGenSettings TextureMipGenSettings::TMGS_NoMipmaps;void* TextureData temp-GetPlatformData()-Mips[0].BulkData.Lock(LOCK_READ_WRITE);FMemory::Memzero(TextureData, width* height * sizeof(FFloat16));//temp-SRGB false;//temp-CompressionSettings TC_Displacementmap;FMemory::Memmove(TextureData, inFArr.GetData(), inFArr.Num() * sizeof(FFloat16));temp-GetPlatformData()-Mips[0].BulkData.Unlock();// 更新纹理数据temp-UpdateResource();UpdateKrigingTexture(temp);return temp; } 纹理采样 方案一 for(int inw0;inwpoint_width;inw) {float2 Kriging_UVfloat2(0,0);Kriging_UV[0]float1(inw/point_width);for(int inh0;inhpoint_height;inh){Kriging_UV[1]float1(inh/point_height);//计算UV偏移float2 offsetfloat2(point_width,point_height);offset1/offset;Kriging_UVfloat2(offset*offsetCoordKriging_UV);//float4 point_TTexture2DSample(in_Tex,Material.Texture2D_0Sampler, Kriging_UV);float3 point_Tin_Tex.Load(int3(Kriging_UV,0));} } 方案二 float4 hTexture2DSample(tex,texSampler,uv) return h; //另外采样方式 //float3 point_Tin_Tex.Load(int3(Kriging_UV,0));
http://www.pierceye.com/news/911550/

相关文章:

  • 高质量的网站内容建设做网站信科网站建设
  • 网站建设倒计时模板学校室内设计效果图
  • 海东营销网站建设公司东莞网络优化排名
  • 株洲网站建设服务建筑公司怎么注册
  • 心理学网站的建设网站开发公司比较有名
  • 需要做网站设计海南网页制作
  • 开发网站有什么用仿站小工具官网
  • 支付宝网站登录入口个人微信公众号如何推广
  • 北京网站制作net2006常见的营销型网站
  • 设计建设网站公司天津市建设信息网官网
  • 企业网站建站 费用比较有名的个人网站
  • 网站规划与开发设计企业班组建设案例
  • 招聘网站开发设计做网站 免费字体
  • 网站上传程序流程桐城住房和城乡建设局网站
  • 回力网站建设初衷ps可以做网站吗
  • 广州网站建设市场佛山专业做网站公司哪家好
  • 四川省凉亭建设工程有限公司网站的博客wordpress
  • 搭建一个网站需要多少钱?如何做网站二级域名
  • 广德县住房和城乡建设网站wordpress网站维护教程
  • 在网站上显示地图金湖县网站建设
  • 网站域名区别吗模板和网站是一体的吗
  • 百度网盟推广怎么选择投放网站抖音seo代理
  • 电商wordpress网站优化百度
  • phpcms v9 网站搬家南通网站设计专家
  • 延安网站建设推广黄骅市网站建设价格
  • 做网站怎么选关键词网站管理强化阵地建设
  • 网站制作是那个cms 导航网站
  • 网站标题优化技巧房产信息网上自助查询系统
  • wordpress电影网教程合肥网站快速排名优化
  • 药房网站模板网站中英文要怎么做