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

网站栏目策划 有思想的新闻软装包括哪些

网站栏目策划 有思想的新闻,软装包括哪些,最好的看vr影片的设备是哪个,哪里有网站制作价格文章目录 介绍自定义shaderNodeMaterial修复#xff1a;骨骼材质特殊处理修复#xff1a;使用法相贴图时整体变色 介绍 Tri-panner 在babylonjs中有支持 但是three.js目前的基础材质并不支持 需要自己定义shader 或者使用目前还没有什么完善的文档的 NodeMaterial 下面展示两… 文章目录 介绍自定义shaderNodeMaterial修复骨骼材质特殊处理修复使用法相贴图时整体变色 介绍 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 commonvarying vec3 tripPosition;varying vec3 tripNormal;);shader.vertexShader shader.vertexShader.replace(#include fog_vertex,#include fog_vertexvec4 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 commonvarying 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_fragmentdiffuseColor.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_vertexnodeVarying2 (modelMatrix * vec4(transformed,1.0)).xyz;); };r155版本写法如下 material.onBeforeCompile (shader) {material.vertexShader shader.vertexShader.replace(#include skinning_vertex,#include skinning_vertexnodeVarying2 ( nodeUniform2 * vec4( transformed, 1.0 ) ););};修复使用法相贴图时整体变色 这个问题nodeMaterial 没找到如何解决 下面给出自定义材质的解决方案 export const useTriplanarMapping (mesh) {const material mesh.material.clone();mesh.material material;material.map.colorSpace THREE.SRGBColorSpace;material.map.wrapS THREE.RepeatWrapping;material.map.wrapT THREE.RepeatWrapping;if (material.normalMap) {material.normalMap.colorSpace THREE.SRGBColorSpace;material.normalMap.wrapS THREE.RepeatWrapping;material.normalMap.wrapT THREE.RepeatWrapping;}material.onBeforeCompile (shader) {shader.vertexShader shader.vertexShader.replace(#include common,#include commonvarying vec3 tripPosition;varying vec3 tripNormal;);shader.vertexShader shader.vertexShader.replace(#include skinning_vertex,#include skinning_vertexvec4 tripPosition4 modelMatrix * vec4(transformed,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 commonvarying 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_fragmentdiffuseColor.rgb vec3(triplanarMapping( map ,tripNormal,tripPosition)););shader.fragmentShader shader.fragmentShader.replace(#include normal_fragment_maps,#include normal_fragment_mapsnormal vec3(triplanarMapping( normalMap ,tripNormal,tripPosition));normal normalize( tbn * normal ););}; };
http://www.pierceye.com/news/121152/

相关文章:

  • 个人网站主页模板如何开一家网络营销公司
  • 网络管理系统密码吴中seo页面优化推广
  • 手绘风格的网站上海做网站cnsosu
  • 怎么做一个免费网站网站app的作用
  • iis 搭建网站品牌建设经验做法
  • 做国外的众筹网站有哪些wordpress小红书主题
  • 扩展名 网站百度资源共享链接分享组
  • 东莞市seo网络推广怎么样杭州seo关键词优化哪家好
  • 做网站用什么ui美观微信公众号调用WordPress
  • 用万网做网站企业做网站怎么做
  • 比较好的网站开发教学网站专业做视频的网站有哪些
  • 户外旅游网站模板网站开发需要看相关书籍
  • 建设高端网站的公司企业营销网站建设公司
  • 重庆建设工程信息网站重庆企业网站建设报价
  • 大兴模版网站开发公司哪家好unn建站
  • 工信部网站域名备案查询北京科技网站建设公司
  • 昆明做网站那家好自己动手做网站
  • 女生做seo网站推广北京海岸设计公司网站
  • 单位建设网站硬件拍摄制作宣传片企业
  • 网站做推广应该如何来做呢哪里推广柳州360优化
  • 淘宝网站的建设目的济宁网站建设 中企动力临沂
  • 小米商城网站建设浏览器广告投放
  • 网站制作论文致谢wordpress首页导航栏
  • 网站右下角调用优酷视频广告代码酒泉地网站推广
  • 武清做网站的wordpress选择php
  • 最潮流的网站开发脚本语言icp网站备案
  • 盘锦网站建设平台wordpress英文模板
  • f2c网站建设公司单位名称大全
  • 泉州最专业手机网站建设哪家好重庆网站备案注销
  • 网站素材类型传统网站有没有建设必要性