POPPUR爱换

 找回密码
 注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

搜索
查看: 4015|回复: 19
打印 上一主题 下一主题

转贴-上古4 FakeHDR(让N卡用户也可以HDR和AA同开!)

[复制链接]
跳转到指定楼层
1#
发表于 2006-12-25 15:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我是什么都不懂的,大家看看就好:a)

原帖链接

http://www3.eastgame.net/read.php?tid=1031207

N卡相对A卡有一个明显的弱点就是不支持HDR和AA同开,所以高人Timeslip(OBMM的作者)开发了FakeHDR这个工具,替代游戏中原有的HDR。FakeHDR的优势是不管是A卡还是N卡都可以和AA同开,当然效果上可能比游戏中原本的HDR差点(其实也不尽然,有人就认为FakeHDR的效果比游戏中原本的HDR更好!:D)

CODE:

//These variables will get set automatically
texture tex1;
texture tex2;
//float2 rcpres;
float CurrentEye;
//float CurrentBrightness;

sampler s0 = sampler_state { AddressU = Clamp; AddressV = Clamp; texture = <tex1>; };
sampler s1 = sampler_state { texture = <tex2>; };

//Use these to modify the behaviour of the dll
bool SinglePixel=false;
bool AffectMenus=false;
int ToggleKey=107;
int ToggleSinglePixelKey=109;
int ToggleAffectMenusKey=106;
float ReactionSpeed=0.95;

//Current Settings
static const float BloomScale = 0.65;
static const float HDRScale = -0.38;
static const float HDRAdjust = -0.10;

//rcpres must be set to the reciprical of your screen resolution
//static const float2 rcpres = { 0.0015625, 0.0020833333333 };    //640x480
//static const float2 rcpres = { 0.00125, 0.0016666666667 };    //800x600
//static const float2 rcpres = { 0.0009765625, 0.0013020833 };    //1024x768
//static const float2 rcpres = { 0.000625, 0.0008333333333 };    //1600x1200
static const float2 rcpres = { 0.00078125, 0.0009765625 };     //1280x1024

float2 PixelKernelH[13] =
{
    { -6, 0 },
    { -5, 0 },
    { -4, 0 },
    { -3, 0 },
    { -2, 0 },
    { -1, 0 },
    {  0, 0 },
    {  1, 0 },
    {  2, 0 },
    {  3, 0 },
    {  4, 0 },
    {  5, 0 },
    {  6, 0 },
};

float2 PixelKernelV[13] =
{
    { 0, -6 },
    { 0, -5 },
    { 0, -4 },
    { 0, -3 },
    { 0, -2 },
    { 0, -1 },
    { 0,  0 },
    { 0,  1 },
    { 0,  2 },
    { 0,  3 },
    { 0,  4 },
    { 0,  5 },
    { 0,  6 },
};

static const float BlurWeights[13] =
{
    0.002216,
    0.008764,
    0.026995,
    0.064759,
    0.120985,
    0.176033,
    0.199471,
    0.176033,
    0.120985,
    0.064759,
    0.026995,
    0.008764,
    0.002216,
};


float4 Bloom( in float2 Tex : TEXCOORD0 ) : COLOR0
{
    float4 Color = tex2D( s0, Tex );
    float tempHDRScale=(0.70*smoothstep(0.00,0.75,CurrentEye))+HDRScale;
    float4 Color2=0;   
    for (int i = 0; i < 13; i++)
    {   
        Color2 += tex2D( s1, Tex + (PixelKernelH*rcpres) ) * BlurWeights;
          Color2 += tex2D( s1, Tex + (PixelKernelV*rcpres) ) * BlurWeights;
    }
    float4 Curvemod = (0.70*Color);
    Color = clamp((0.30*Color)+((0.70-Curvemod+tempHDRScale)*pow(Color,2))+((Curvemod-tempHDRScale)*(1-pow((1-Color),2))),0,1);
    Color2 *= (BloomScale-(0.00*CurrentEye));
    return clamp(Color + Color2,0,1);
}

float4 HDRBrightPass( in float2 Tex : TEXCOORD0 ) : COLOR0
{
    float4 color = tex2D( s0, Tex );
    float tempbright = clamp((0.27*color[1])+(0.67*color[2])+(0.06*color[3]),0,1);
    float HDRAdjustBias = (0.18*pow((1-CurrentEye),3));
    float curvemod = (0.25*tempbright);
    float4 colorbias = (1-pow((1-color),2));
    float4 adjust = clamp(((color-CurrentEye)-HDRAdjust-(HDRAdjustBias)),0,1);
    color = clamp((8*pow(adjust,5)),0,1);
    //color += clamp(tex2D( s1, Tex ) - (2*(CurrentEye + 0.10)) ,0,0.75); //Uncomment this line for retina burn
    color = clamp(((1-curvemod+HDRAdjustBias)*color)+((curvemod-HDRAdjustBias)*colorbias),0,1);
    color.a = 1;
    return color;
}

technique T0
{
    pass p0 { PixelShader = compile ps_2_0 HDRBrightPass(); }
    pass p1 { PixelShader = compile ps_2_0 Bloom();    }
}
2#
发表于 2006-12-25 15:08 | 只看该作者
另一种实现方式的HDR+AAw00t) w00t)
回复 支持 反对

使用道具 举报

3#
发表于 2006-12-25 15:17 | 只看该作者
原帖由 a_skywalker 于 2006-12-25 15:16 发表
和真正的HDR不能比的。


你用过吗?恐怕见都没见过吧?w00t)
回复 支持 反对

使用道具 举报

4#
 楼主| 发表于 2006-12-25 15:20 | 只看该作者
原帖由 jhj9 于 2006-12-25 15:17 发表


你用过吗?恐怕见都没见过吧?w00t)

不知道你这个pro-n知道不知道(_(

上测试吧w00t)
回复 支持 反对

使用道具 举报

5#
发表于 2006-12-25 15:27 | 只看该作者
原帖由 casper2003 于 2006-12-25 15:20 发表

不知道你这个pro-n知道不知道(_(

上测试吧w00t)


上古4我都没下载,无法进行测试:p
回复 支持 反对

使用道具 举报

6#
 楼主| 发表于 2006-12-25 15:30 | 只看该作者
原帖由 jhj9 于 2006-12-25 15:27 发表


上古4我都没下载,无法进行测试:p

你这个pro-n不称职啊w00t)
回复 支持 反对

使用道具 举报

7#
发表于 2006-12-25 15:34 | 只看该作者
原帖由 casper2003 于 2006-12-25 15:30 发表

你这个pro-n不称职啊w00t)

NO。他很称职,因为他知道他用N卡无福享受上古4,下了也只能看满屏牙的画面,故与其倒胃口,不如宁缺勿烂,JHJ是个聪明人嘛:loveliness:
回复 支持 反对

使用道具 举报

fiorentina 该用户已被删除
8#
发表于 2006-12-25 15:54 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

9#
发表于 2006-12-25 16:46 | 只看该作者
原帖由 fiorentina 于 2006-12-25 15:54 发表
G80上古4开HDR+AA唯一的问题就是16AA和4AA画质没区别,速度有区别


4X和16XAA低分辨率下没区别,但分辨率越高,AA的倍数要求也越高:thumbsup:
回复 支持 反对

使用道具 举报

10#
发表于 2006-12-25 17:39 | 只看该作者
This mod adds a fake HDR effect using sm2.0 shaders for us poor unfortunate souls who don't own sm3.0 capable graphics cards. I don't know how it compares to the sm3.0 effect, since I haven't got a sm3.0 card, and can barely run oblivion at all. It will cause a speed hit, but again, I cant compare it to the sm3.0 effect. It does have the major advantage of being completely compatible with AA. You can toggle the shader ingame by hitting the nupmap '+' key. If you need to change this key, download the standard version.

补丁作者的说明
回复 支持 反对

使用道具 举报

11#
发表于 2006-12-25 19:26 | 只看该作者
我的yy






[ 本帖最后由 cloudol 于 2006-12-25 23:36 编辑 ]
回复 支持 反对

使用道具 举报

12#
发表于 2006-12-25 19:29 | 只看该作者
原帖由 cloudol 于 2006-12-25 19:26 发表
我yy 1280x1024 16x af 16x qaa


看到这个角色感觉好像漫画“大剑”里的组织第1号战士
甲也是黑的w00t)
回复 支持 反对

使用道具 举报

13#
发表于 2006-12-25 19:36 | 只看该作者
原帖由 jhj9 于 2006-12-25 19:29 发表


看到这个角色感觉好像漫画“大剑”里的组织第1号战士
甲也是黑的w00t)


我装了几个mod 人物 和盔甲都是mod出的

还有高材质补丁

随便进森林 vram占用就过512了
回复 支持 反对

使用道具 举报

14#
发表于 2006-12-25 20:57 | 只看该作者
原帖由 cloudol 于 2006-12-25 19:36 发表


我装了几个mod 人物 和盔甲都是mod出的

还有高材质补丁

随便进森林 vram占用就过512了


没我这个漂亮,哈哈哈哈:lol:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

15#
 楼主| 发表于 2006-12-25 21:11 | 只看该作者
我这个才叫有欣赏价值:wub:

回复 支持 反对

使用道具 举报

让爱去旅游 该用户已被删除
16#
发表于 2006-12-26 00:12 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

17#
 楼主| 发表于 2006-12-26 12:11 | 只看该作者
有没有PRO-N测试过啊?:wub:
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

广告投放或合作|网站地图|处罚通告|

GMT+8, 2025-11-14 01:14

Powered by Discuz! X3.4

© 2001-2017 POPPUR.

快速回复 返回顶部 返回列表