游戏开发论坛

 找回密码
 立即注册
搜索
查看: 7368|回复: 0

????????????????????

[复制链接]

8717

主题

8783

帖子

1万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
11952
发表于 2018-8-7 11:05:56 | 显示全部楼层 |阅读模式
??

??????????????????????????

??

?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

1??????????????????????????????????????????????????

??395.png
?? Bob???????? flash ??

2??????????????????????????

??547.png
HGSS ?? Dragon Den

3???????????????????????

??593.png
Drill Dozer ??

?????? UI ?????????????????????????????????????????????????????

???3??????????????

????????????????????????????????????????????????????????????????????? GB ? GBC????????2????15???????????????????????????????????????????????????????????????????????????????

?????

? GBA ???????240 *160?????????????????????????????????????????????????????????????????????????????????????1080p ??????????????????????????????????????????????

??1032.png
??????3????????????????????

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

????? ppsspp ????????????? shader ?????????????2D ??????????? xBRZ ???????????xBRZ ?2D ??????????????????????????????? crt, ??????????????????????????????????? CRT ?????????

????????????? crt ??????????????????????????

??1721.png

????????

??1732.png

from-pixel-to-screen-1-7.jpg
???????????? crt ????????

??1762.png
???????

????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? Her Story ??????????? crt ???

??????????? post processing shader????????

?? shader ?????

???????????????????????????????????????????????????????? LCD ????? CRT ???????????????????????????????????? psp ????????????? Tactics Ogres??????????????

???????????????????1.????????????????????????????2.???????????????????????????????????????

?????????????? CG ???????????512 x 384

?????

???

?????????2????????????? pixel???? texel ??????2 x 2?????????????????????????????????????????????????????????????????????????????????????????????????????????2???????????4?????????????

from-pixel-to-screen-1-9.png
????????????

from-pixel-to-screen-1-10.png
????????????

??????????????? camera input????1 texel ?? 4 pixel?????1 texel ?? 16 pixel?

?????????????????????????????????, ????????4*4????????????????? vec2?

  1. o.pixel_no = float2(o.uv.x * _MainTex_TexelSize.z, o.uv.y * _MainTex_TexelSize.w) * 0.25;
复制代码

_MainTex_TexelSize???? uniform??????????????? zw ?????????? ppsspp ?????????u_texelDelta??????? resolution???????

?? pixel_no ??????????????????????

  1. fixed4 Pass_Scanline(float2 uv) {
  2.        float column = 4;
  3.        float2 pixel_no =
  4.            frac(float2(uv.x * 1024.0, uv.y * 768) * _ScreenScale / column);
  5.        if(pixel_no.x < 1 / column || pixel_no.y < 1 / column)
  6.            return PREVIOUS_PASS(uv) * 0.5;
  7.        else
  8.        return PREVIOUS_PASS(uv);
  9. }
复制代码

?? PREVIOUS_PASS ?????????? multi-pass???? PREVIOUS_PASS ?????????????????? pass???? column ?4???????????????? pixel_no ? x ?????1/8, 3/8, 5/8, 7/8?????????????????????????????

?????????????????????????????????????????????????????????? asset store ?????????

??????

??????????????????????????????????????????????????????????????????????? pixel ? texel ??????????????3?????2??????4???????????

???????????????????????????????????????????????????????????????????????????????????????????????

???????????????????????????????????????????????????

1.png

?????????????????????????????????

??4079.png
??????????????????????

???

????????????????????kernel????????????????????????????????Gaussian Filter???????????????????Themaister ??????????????? git ?????????????????????????????GLSL ?????????????

??4424.png
?????????????????????????????

???????????????????4x4?????????8??????????????????????????????????????????????????????????????????????????????????????????????????????

??4591.png
1??????9???

??4605.png
??????????????????????????

?????????????????????????????????????????????

??4680.png
??? Exp( -2.05 * ??????)

??4707.png
??? Exp( -2.05 * ????)

???????????????????????????????????????????????????????

??????????????????????????????????????????????????????????????????????????

??4863.png

???????????????????????????????????

????????

??4901.png

??4903.png

????

??????

Themaister ??????????????????????????????????????????????????????????????????????????????????????????????? Glow ????????????

  1. float color_bloom(float3 color)
  2. {
  3.     // const float3 gray_coeff = float3(0.30, 0.59, 0.11);
  4.     const float shine = 0.25;
  5.     float bright = Luminance(color);//dot(color, gray_coeff);
  6.     return lerp(1.0 + shine * 0.5, 1.0 - shine, bright);
  7. }
复制代码

???????????? gray_coeff ?????????? unity ????????????gray_coeff?? fixed3(0.22, 0.707, 0.071)

?????? lerp ??????????????????????????????????

No.???

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? pixel_no ??????????????????????????????????????1/(column * 2)?????????????

  1. float?delta = dist(frac(pixel_no + float2(-0.125,?0.125)), offset + float2(0.5,?0.5));
复制代码

??5911.png

??5914.png

????????????????????????????????????????????

from-pixel-to-screen-1-23.png
????????????

?????

??????????????????????????????????????????????????????????????????????????????????? ps ?????????????????????????????????????????????

??6115.png
????????????

??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

????????????????????????????????????????????????????????????????

??6338.png

??6340.png

?????????????

??????????????????????????????????????????????????????????????

??6419.png
??????????????????????????????

??????????????????????????????????????

?? bloom

Bloom ?????????????????????????bloom ???? HDR ??????????? Tone Mapping?Bright Pass Filter ?? Blur???????????2D ???????? HDR ?????????????????? ToneMapping ????? Bright ? Blur?

1?????? bloom ???? bloom

????? bloom ?? blur ????????????????????????????????????????????????? pass ?????????????????????????

  1. fixed4 Pass_SimpleBloom(float2 uv)
  2. {
  3.     float4 sum = float4(0, 0, 0, 0);
  4.     float4 bum = float4(0, 0, 0, 0);
  5.    
  6.     float2 glareSize = float2(1.0 / 512, 1.0 / 384) * 0.65;
  7.     int height = 3;
  8.     int width = 1;
  9.     for(int i = -width; i < width; i++)
  10.     {
  11.         for(int j = -height; j < height; ++j)
  12.         {
  13.             sum += tex2D(_MainTex, uv + float2(i, j) * glareSize);
  14.             bum += tex2D(_MainTex, uv + float2(j, i) * glareSize);
  15.         }
  16.     }
  17.     fixed4 color = PREVIOUS_PASS(uv);
  18.     color = (sum*sum*0.001 + bum*bum*0.0080) * _Amount / ((2* height +1) *(2* width +1)) + color*_Power;
  19.     return color;
  20. }
复制代码

renderTexture ? multipass

Bloom ???????? ppsspp ??????????????????? ppsspp ?????? multi-pass shader????????? pass ??????? bloom ?????????????????????

?????? unity ????????????????? pass ?? bloom ??????? render texture ??????? shader ???????????????????? single-pass ?1/5?????????????

  1. RenderTexture rtTemp = RenderTexture.GetTemporary(src.width, src.height);
  2. Graphics.Blit(src, rtTemp, _Material_1);
  3. Graphics.Blit(rtTemp, dst, _Material_2);
  4. RenderTexture.ReleaseTemporary(rtTemp);
复制代码

2.png
??????????????????? drawIndexed ?

??7945.png

????????? pass ??????????????unity ???? RenderTexture.GetTemporary ???????DiscardContents????? CPU ????????????????????

??? bloom ???????

??8426.png

22.jpg


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

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-12 05:04

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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