惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Troy Hunt's Blog
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
F
Full Disclosure
Recorded Future
Recorded Future
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
博客园_首页
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hacker News: Front Page
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 司徒正美
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
Cloudbric
Cloudbric
PCI Perspectives
PCI Perspectives
有赞技术团队
有赞技术团队
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
L
Lohrmann on Cybersecurity
量子位
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
N
News and Events Feed by Topic
罗磊的独立博客
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
T
Tor Project blog
IT之家
IT之家
M
MIT News - Artificial intelligence
S
Security @ Cisco Blogs
O
OpenAI News
AI
AI
S
Securelist
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题

博客园 - 稻草人的麦田

[导入]显卡对于mipmap选择的研究 [导入]仔细研究了lithtech中的根据类名创建对象 [导入]光照优缺点 [导入]蜗牛的笔试题目 [导入]一个开发休闲游戏的程序组人与分配方案 [导入]运动模糊的制作 [导入]格里高里的数学题 [导入]水彩化 [导入]描边,只是换了个过滤器而已 [导入]锐化模糊 [导入]卷积积分(转) [导入]再贴个圆形马赛克 [导入]马赛克 [导入]hlsl的浮雕效果 [导入]游戏出了一个demo [导入]图形文件的格式(转载) [导入] 一些色彩方面的知识 [导入]流浪歌手 [导入][转载]游戏引擎列表
[导入]伪 HDR/Blow
稻草人的麦田 · 2007-10-17 · via 博客园 - 稻草人的麦田

我用的fx composer 来做这个效果,感觉挺假的,先制作一个贴图,然后再制作一个该贴图1/4大小的的贴图,贴图内容肯定要一样,从小贴图上获取亮度信息,然后加入到大的贴图上,就是采用相乘的方法,这个例子的最主要难度在于想出一个二次曲线来重新调整图像的亮度,这里用的曲线的方程是:

x [ (2-4k) x + 4k-1 ]     K的取值范围为0.5 – 2.0

shader的最上面写上多的一个贴图

texture diffuse2
<
>;

然后在右边的属性栏里为这个材质选择1/4大小的那个贴图。

再加入一个新的采样器:

sampler TextureSampler2 = sampler_state
{
    texture = <diffuse2>;
    AddressU  = CLAMP;       
    AddressV  = CLAMP;
    AddressW  = CLAMP;
    MIPFILTER = LINEAR;
    MINFILTER = LINEAR;
    MAGFILTER = LINEAR;
};

其实都是照抄,变量后加入一个数字。

代码如下:

float4  xposure(float4 _color , float gray , float ex)
{

     float b = ( 4 * ex -  1 );

     float a = 1 - b;

     float f = gray * ( a * gray + b );

     return   f * _color;

}

//-----------------------------------
float4 PS_Textured( vertexOutput IN): COLOR
{
  //亮度信息从downSample后的图像中获得
float k=2.0;
float4 _dsColor = tex2D(TextureSampler2 , IN.texCoordDiffuse);

    float _lum = 0.3 * _dsColor.x + 0.59 * _dsColor.y + 0.11* _dsColor.z;

float4 _fColor = tex2D(TextureSampler , IN.texCoordDiffuse);

//对最终颜色进行修正

    return xposure(_fColor , _lum , k);
}

k取的是2.0,是比较高的。变化前后的图如下:

我没觉得效果有什么好的,虽然我也不知道调整亮度的那个二次方程是怎么计算出来的。

文章来源:http://songxiaoyu8.blog.163.com/blog/static/20818128200791733919230