fragment shader的优化
ALU:
浮点数精度 选择性降低
shader 指令数 替换一些计算减小指令sqrt, sin, cos, recip
光照 计算用lightmap(用memory sample换计算)
vertex light(tbdr 不推荐 vs开销太大)
look up texture
Mem:
最后一段 textuer fetch bound register pressure
CBV:
register counts
fragement shader的 变量也会成为flight的瓶颈 所以确认瓶颈很重要
因为register counts的限制 一个shader用了太多变量 并行起来的shader个数就会受到限制
还有个值得注意的地方
需要关注vs--ps之间插值数据大小
control flow:
分支 循环
数据同步的wait
从外面来解决这个问题 overdraw 直接把不需要计算的shader去掉(zprepass or hsr) 降低resolution
===================
vs
频繁更新的 vertex buffer 数据和基本不更新的数据分两块buffer放 有效利用cache
fragment shader的优化的更多相关文章
- 片元着色器(Fragment Shader)被称为像素着色器(Pixel Shader),但
片元着色器(Fragment Shader)被称为像素着色器(Pixel Shader),但片元着色器是一个更合适的名字, 因为此时的片元并不是一个真正意义上的像素.
- UnityShader之顶点片段着色器Vertex and Fragment Shader【Shader资料】
顶点片段着色器 V&F Shader:英文全称Vertex and Fragment Shader,最强大的Shader类型,也是我们在使用ShaderLab中的重点部分,属于可编程管线,使用 ...
- Unity Shaders Vertex & Fragment Shader入门
http://blog.csdn.net/candycat1992/article/details/40212735 三个月以前,在一篇讲卡通风格的Shader的最后,我们说到在Surface Sha ...
- 【Unity Shaders】Vertex & Fragment Shader入门
写在前面 三个月以前,在一篇讲卡通风格的Shader的最后,我们说到在Surface Shader中实现描边效果的弊端,也就是只对表面平缓的模型有效.这是因为我们是依赖法线和视角的点乘结果来进行描边判 ...
- GLSL写vertex shader和fragment shader
0.一般来说vertex shader处理顶点坐标,然后向后传输,经过光栅化之后,传给fragment shader,其负责颜色.纹理.光照等等. 前者处理之后变成裁剪坐标系(三维),光栅化之后一般认 ...
- Stage3d 由浅到深理解AGAL的管线vertex shader和fragment shader || 简易教程 学习心得 AGAL 非常非常好的入门文章
Everyday Stage3D (一) Everyday Stage3D (二) Triangle Everyday Stage3D (三) AGAL的基本概念 Everyday Stage3D ( ...
- Learn to Create Everything In a Fragment Shader(译)
学习在片元着色器中创建一切 介绍 这篇博客翻译自Shadertoy: learn to create everything in a fragment shader 大纲 本课程将介绍使用Shader ...
- Vertex And Fragment Shader(顶点和片段着色器)
Vertex And Fragment Shader(顶点和片段着色器) Shader "Unlit/ Vertex_And_Fragment_Shader " { Proper ...
- 3D Computer Grapihcs Using OpenGL - 07 Passing Data from Vertex to Fragment Shader
上节的最后我们实现了两个绿色的三角形,而绿色是直接在Fragment Shader中指定的. 这节我们将为这两个三角形进行更加自由的着色——五个顶点各自使用不同的颜色. 要实现这个目的,我们分两步进行 ...
随机推荐
- ZOJ-3319
Islands Time Limit: 1 Second Memory Limit: 32768 KB There are N islands and some directed paths ...
- zoj 3195
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3320 离线算法RE了.. #include<stdio.h> #i ...
- Longest Palindromic Substring (最长回文字符串)——两种方法还没看,仍需认真看看
Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...
- 【hdoj_2187】老人是真饿了
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2187 题意:由很多种价格的大米,在经费一定的情况下,买重量更多的大米,并且题目假设经费买不光所有的大米. ...
- AC日记——The Shortest Path in Nya Graph hdu 4725
4725 思路: 拆点建图跑最短路: 代码: #include <cstdio> #include <cstring> #include <iostream> #i ...
- 配合bootstrap实现的table 嵌套table
不要忘了引入bootstrap.css库 html部分 <div class="container"> <div class="row"> ...
- 动态创建timer
Private timer:Ttimer;procedure MyTimerDo(Sender:Tobject);procedure create ; timer:=TtIMER.Create; ...
- 论文笔记-RCNN
CAFFE玩了也有段时间了,现在开始准备研究一下物体检测,现在知道的有RCNN.spp-net.Fast-RCNN和Faster-RCNN,作为菜鸟我还是从头学习,决定先看RCNN,因为有项目要做还要 ...
- [THINKPHP] 温故知新之getFieldBy
1.getFieldBy id name 1 Mike 需求1:想要获取Mike M('table')->getFieldById('1','name'); 需求2:想要获取id的值1 M('t ...
- 如何求先序排列和后序排列——hihocoder1049+洛谷1030+HDU1710+POJ2255+UVA548【二叉树递归搜索】
[已知先序.中序求后序排列]--字符串类型 #1049 : 后序遍历 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Ho在这一周遇到的问题便是:给出一棵二叉树的前序和 ...