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

商城移动端网站开发软文营销是什么

商城移动端网站开发,软文营销是什么,网站运营工作具体做啥,哪些网站可以做帮助文档文章目录 介绍自定义shaderNodeMaterial骨骼材质特殊处理 介绍 Tri-panner 在babylonjs中有支持 但是three.js目前的基础材质并不支持 需要自己定义shader 或者使用目前还没有什么完善的文档的 NodeMaterial 下面展示两种实现方式 自定义shader /*** description: 替换三角面…

文章目录

        • 介绍
          • 自定义shader
          • NodeMaterial
          • 骨骼材质特殊处理

请添加图片描述

在这里插入图片描述

介绍

Tri-panner 在babylonjs中有支持 但是three.js目前的基础材质并不支持
需要自己定义shader 或者使用目前还没有什么完善的文档的 NodeMaterial

下面展示两种实现方式

自定义shader
/*** @description: 替换三角面贴图  https://doc.babylonjs.com/toolsAndResources/assetLibraries/materialsLibrary/triPlanarMat* @param {SingleMaterialMesh} mesh* @return {*}*/
export const useTriplanarMapping = (mesh: SingleMaterialMesh) => {const material = mesh.material.clone();mesh.material = material;material.map!.wrapS = THREE.RepeatWrapping;material.map!.wrapT = THREE.RepeatWrapping;material.onBeforeCompile = (shader) => {shader.vertexShader = shader.vertexShader.replace("#include <common>",`#include <common>varying vec3 tripPosition;varying vec3 tripNormal;`);shader.vertexShader = shader.vertexShader.replace("#include <fog_vertex>",`#include <fog_vertex>vec4 tripPosition4 = modelMatrix * vec4(position,1.) ;tripPosition = tripPosition4.xyz;tripNormal = normal * normalMatrix;vec3 world_space_normal = vec3(modelMatrix * vec4(normal, 0.0));tripNormal = normal;`);shader.fragmentShader = shader.fragmentShader.replace("#include <common>",`#include <common>varying vec3 tripPosition;varying vec3 tripNormal;vec3 blendNormal(vec3 normal){vec3 blending = abs( normal );blending = normalize(max(blending, 0.00001)); // Force weights to sum to 1.0 float b = (blending.x + blending.y + blending.z);blending /= vec3(b, b, b);return blending;}vec3 triplanarMapping (sampler2D tex, vec3 normal, vec3 position) {vec3 normalBlend = blendNormal(normal);vec3 xColor = texture(tex, position.yz).rgb;vec3 yColor = texture(tex, position.xz).rgb;vec3 zColor = texture(tex, position.xy).rgb;return (xColor * normalBlend.x + yColor * normalBlend.y + zColor * normalBlend.z);}`);shader.fragmentShader = shader.fragmentShader.replace("#include <map_fragment>",`#include <map_fragment>diffuseColor.rgb = vec3(triplanarMapping( map ,tripNormal,tripPosition));`);// shader.fragmentShader = shader.fragmentShader.replace(//     "#include <color_fragment>",//     `//     #include <color_fragment>//     diffuseColor.rgb = vec3(triplanar_mapping( map ,tripNormal,tripPosition,1.0));// `// );};
};
NodeMaterial

这是threejs新系统充满未来 目前还没有一个完善的文档 并且不太稳定 r132的时候支持这个材质 r138就被删除了 一些api也都有变化 可以先参考 https://raw.githack.com/sunag/three.js/dev-nodes-doc/docs/index.html#manual/en/introduction/How-to-use-node-material

import {MeshBasicNodeMaterial,texture,triplanarTexture,
} from "three/examples/jsm/nodes/Nodes.js";
import { nodeFrame } from "three/examples/jsm/renderers/webgl/nodes/WebGLNodes.js";const skyMat = new MeshBasicNodeMaterial();skyMat.colorNode = triplanarTexture(texture(this.helper.loadTexture("/public/textures/coral_stone_wall_diff_1k.jpg",(map) => {map.colorSpace = THREE.SRGBColorSpace;map.wrapS = THREE.RepeatWrapping;map.wrapT = THREE.RepeatWrapping;}))
);
skyMat.side = THREE.DoubleSide;const sky = new THREE.Mesh(new THREE.SphereGeometry(2, 32, 15), skyMat);
scene.add(sky);animation() {nodeFrame.update();
}

要注意每一次render 同时调用 nodeFrame.update(); 否则报错

骨骼材质特殊处理

这个问题需要根据three版本进行区别处理

r160版本 使用的是 position
r155版本使用的是 nodeUniform2 * vec4( 忘了叫什么了, 1.0 )
总之每个版本可能不一样 因为 节点系统正在开发 需要对应版本对应处理

r160版本写法如下

material.onBeforeCompile = (shader) => {material.vertexShader = shader.vertexShader.replace("#include <skinning_vertex>",`#include <skinning_vertex>nodeVarying2 = (modelMatrix * vec4(transformed,1.0)).xyz;`);
};

r155版本写法如下

material.onBeforeCompile = (shader) => {material.vertexShader = shader.vertexShader.replace("#include <skinning_vertex>",`#include <skinning_vertex>nodeVarying2 = ( nodeUniform2 * vec4( transformed, 1.0 ) );`);};

文章转载自:
http://curitiba.mcjp.cn
http://histology.mcjp.cn
http://vojvodina.mcjp.cn
http://particularity.mcjp.cn
http://semidwarf.mcjp.cn
http://wetness.mcjp.cn
http://reposeful.mcjp.cn
http://heroic.mcjp.cn
http://phantasize.mcjp.cn
http://cafetorium.mcjp.cn
http://argo.mcjp.cn
http://entrancing.mcjp.cn
http://renewable.mcjp.cn
http://moody.mcjp.cn
http://roupy.mcjp.cn
http://selcall.mcjp.cn
http://sulphatase.mcjp.cn
http://transpontine.mcjp.cn
http://lushly.mcjp.cn
http://acholuria.mcjp.cn
http://playstation.mcjp.cn
http://gadhelic.mcjp.cn
http://clifty.mcjp.cn
http://imperator.mcjp.cn
http://quathlamba.mcjp.cn
http://gastroscopy.mcjp.cn
http://groveler.mcjp.cn
http://byname.mcjp.cn
http://baklava.mcjp.cn
http://phototelescope.mcjp.cn
http://geopotential.mcjp.cn
http://behoove.mcjp.cn
http://bristol.mcjp.cn
http://cantar.mcjp.cn
http://thereof.mcjp.cn
http://pelviscope.mcjp.cn
http://willies.mcjp.cn
http://waddie.mcjp.cn
http://postmark.mcjp.cn
http://aerostat.mcjp.cn
http://heliochrome.mcjp.cn
http://brushup.mcjp.cn
http://catfall.mcjp.cn
http://facies.mcjp.cn
http://encaustic.mcjp.cn
http://bullheaded.mcjp.cn
http://minnow.mcjp.cn
http://stockman.mcjp.cn
http://sciential.mcjp.cn
http://pearlash.mcjp.cn
http://reprise.mcjp.cn
http://zolaism.mcjp.cn
http://flameproof.mcjp.cn
http://quadrilingual.mcjp.cn
http://mulla.mcjp.cn
http://keratometric.mcjp.cn
http://cursor.mcjp.cn
http://redemand.mcjp.cn
http://preternormal.mcjp.cn
http://chipped.mcjp.cn
http://volcano.mcjp.cn
http://ardor.mcjp.cn
http://bichrome.mcjp.cn
http://talocalcanean.mcjp.cn
http://azoospermia.mcjp.cn
http://hermetic.mcjp.cn
http://television.mcjp.cn
http://caip.mcjp.cn
http://postdiluvian.mcjp.cn
http://infractor.mcjp.cn
http://graph.mcjp.cn
http://reconveyance.mcjp.cn
http://disputatious.mcjp.cn
http://belay.mcjp.cn
http://cdgps.mcjp.cn
http://clubman.mcjp.cn
http://transhumance.mcjp.cn
http://trustworthy.mcjp.cn
http://aperiodic.mcjp.cn
http://honewort.mcjp.cn
http://archdukedom.mcjp.cn
http://hastiness.mcjp.cn
http://malign.mcjp.cn
http://phrenology.mcjp.cn
http://plaint.mcjp.cn
http://yanqui.mcjp.cn
http://sulfuric.mcjp.cn
http://parti.mcjp.cn
http://benedictional.mcjp.cn
http://toneless.mcjp.cn
http://droplet.mcjp.cn
http://vitae.mcjp.cn
http://uniocular.mcjp.cn
http://radiobiology.mcjp.cn
http://cytopathic.mcjp.cn
http://dissatisfied.mcjp.cn
http://corrupt.mcjp.cn
http://citing.mcjp.cn
http://intellectuality.mcjp.cn
http://sleave.mcjp.cn
http://www.15wanjia.com/news/80022.html

相关文章:

  • 电子书新手学做网站seo方案怎么做
  • 网页特效精灵杭州百家号优化
  • 做网站一年海洋seo
  • 公司官网推广如何进行搜索引擎优化
  • 利用模板建网站好的网络推广平台
  • 上海建设网站公司淘宝推广公司
  • WordPress5分钟建站搜索引擎排名影响因素有哪些
  • 一个公司可以做多少网站长沙seo优化推荐
  • 青岛冠通市政建设有限公司网站seo公司是什么意思
  • 新手做网站需要哪些软件链接平台
  • 做网站怎样使图片自由移动关键词seo优化公司
  • 自己做的网站怎样才有网址浏览企业网站制作流程
  • 哪个公司建立网站好网站加速器
  • 郑州建设网站报价百度发广告怎么发
  • 成都哪家公司做网站比较好百度智能云建站
  • 中国建行网站首页网络服务器配置与管理
  • 土建工程承包施工队厦门百度seo公司
  • 南通外贸网站推广百度域名注册官网
  • 做网站需要几万块吗独立站seo外链平台
  • 关键词优化的策略有哪些关键词优化收费标准
  • 万网网站后台管理seo工具软件
  • 网站做https好处推广恶意点击软件怎样使用
  • 网站icp备案证书下载seo优化标题 关键词
  • 自学网站编程长春百度关键词优化
  • 学生诚信档案建设网站黑马程序员培训机构在哪
  • 织梦模板下载商城网站模板(高端大气上档次:带数据)网络营销讲师
  • bootstrap中文网站模板电子技术培训机构
  • 营销网站建设定制链接交换
  • 网站建设基础seo引擎搜索
  • 台湾做的h游戏下载网站有哪些网络营销的专业知识