1 | 1) change shader system: look into fx files
|
---|
2 | 2) tone mapping
|
---|
3 | bloom (gaussian blur)
|
---|
4 | use downsampling: first 4x4 to luminance then 3 times further to 1x1
|
---|
5 | use 3 new render render targets for this
|
---|
6 |
|
---|
7 | 3) mrt channels:
|
---|
8 |
|
---|
9 | 2 mrts:
|
---|
10 |
|
---|
11 | mrt 1: rgba color + emmissive / luminance
|
---|
12 | mrt 2: world pos + projected depth
|
---|
13 | mrt 3: normals + w coordinate
|
---|
14 | mrt 4: flip-flop for mrt1
|
---|
15 |
|
---|
16 |
|
---|
17 | 4) idea: donwsample color texture for ao
|
---|
18 |
|
---|
19 | 5) use depth formula on projected depth (or use linear depth)
|
---|
20 | in order to combine ao + diffuse lookup into on texture lookup
|
---|
21 |
|
---|
22 |
|
---|
23 | reorder mrts:
|
---|
24 |
|
---|
25 | mrt 1: rgba color + projected depth
|
---|
26 | mrt 2: luminance
|
---|
27 | mrt 3: normals + w coordinate
|
---|
28 | mrt 4: flip-flop with mrt1 / store luminance after ssao
|
---|
29 |
|
---|
30 |
|
---|
31 | 6) render sun disc
|
---|
32 |
|
---|
33 |
|
---|
34 |
|
---|
35 | ssao:
|
---|
36 |
|
---|
37 | 1) implement bilateral filtering
|
---|
38 | 2) check physical properties
|
---|
39 |
|
---|
40 | paper of 2007 arikan formula:
|
---|
41 |
|
---|
42 | SW(P, C, r) = 2 * pi * (1 - cos(asin (r / |PC|)))
|
---|
43 |
|
---|
44 | but not working properly!
|
---|
45 |
|
---|
46 | 3) normal mapping
|
---|
47 |
|
---|
48 | working but already done!
|
---|
49 |
|
---|
50 |
|
---|
51 | problems:
|
---|
52 |
|
---|
53 | 4) update of converged regions
|
---|
54 |
|
---|
55 | something could become visible
|
---|
56 |
|
---|
57 | a) from outside
|
---|
58 | b) from previously occluded regions
|
---|
59 |
|
---|
60 | a) could use ratio of samples outside current frame / last frame
|
---|
61 | but slows donw code
|
---|
62 |
|
---|
63 | 5) dynamic objects:
|
---|
64 |
|
---|
65 | a) make ao stick on object: this should
|
---|
66 | be possible somehow, as the information is still available!!
|
---|
67 |
|
---|
68 | tried to use difference of ao intensity between previous and
|
---|
69 | current frame to find out if pixel ao is not valid anymore.
|
---|
70 | but problems as some flickering was introduced while update of
|
---|
71 | dynamic objects was not fast enough (annoying grey fade effect)
|
---|
72 |
|
---|
73 | b) fix the contact shadow on the floor:
|
---|
74 |
|
---|
75 | check when pixel not valid anymore: do that by checking for each
|
---|
76 | sample if they were invalidated recently. if so, then invalidate
|
---|
77 | current pixel ao. for each point, theoretically you don't have
|
---|
78 | to compare the depth of the current pixel, but the depth of the
|
---|
79 | samples taken for ao
|
---|
80 |
|
---|
81 |
|
---|
82 | idea for incorporation of dynamic objects:
|
---|
83 |
|
---|
84 | store object id with render target
|
---|
85 | for each object we know the trafo
|
---|
86 | when doing the back projection =>
|
---|
87 |
|
---|
88 | as usual:
|
---|
89 | we have the world space position of the current pixel
|
---|
90 | find pixel from last frame using the old projection view trafo
|
---|
91 |
|
---|
92 | but now we first apply the inverse transformation that brought the
|
---|
93 | last pixel to the current pixel and then the old projection view!!
|
---|
94 |
|
---|
95 | => now we do the equality comparison as usual
|
---|
96 |
|
---|
97 |
|
---|
98 | for reducing flickering:
|
---|
99 |
|
---|
100 |
|
---|
101 | keep chain of kernels constant based on the state of convergence=>
|
---|
102 |
|
---|
103 | only use a single kernel, rotate based on noise texture
|
---|
104 | we use fixed offset into the noise texture based on the #frames samples were accumulated
|
---|
105 |
|
---|
106 | problem:
|
---|
107 |
|
---|
108 |
|
---|
109 |
|
---|
110 | =========================
|
---|
111 |
|
---|
112 | 1) ssao filter kernel: grows smaller too fast => flickering ... use
|
---|
113 | adaptive number of samples instead of size?
|
---|
114 | 2) fix color bleeding
|
---|
115 | 3) fix ssao2 so that ssao contribution stays constant
|
---|
116 | 4) find physical expressions for constants in ssao
|
---|
117 | 5) retry normal discontinuity for ssao filter
|
---|
118 | 6) fix adaptive sampling for ssao and ssao2
|
---|
119 | a) sample adaptive if found invalid sample
|
---|
120 | b) sample adaptive if number of valid samples small?
|
---|
121 |
|
---|
122 | q: is it good to choose new weight as we do? (approx 4 frames)
|
---|
123 | or shouldn't we just completely reset sample?
|
---|
124 |
|
---|
125 |
|
---|
126 |
|
---|
127 | shading todo:
|
---|
128 |
|
---|
129 | bloom
|
---|
130 | dof
|
---|
131 | lense flar
|
---|
132 | god rays
|
---|
133 | sun disc
|
---|
134 | environment lighting |
---|