Line | |
---|
1 | ///////////////////////////////////////////////////////////////////////////////
|
---|
2 | //
|
---|
3 | // ## ######
|
---|
4 | // ###### ###
|
---|
5 | // ## ############### Shark 3D Engine (www.shark3d.com)
|
---|
6 | // ########## # # #
|
---|
7 | // ######## Copyright (c) 1996-2006 Spinor GmbH.
|
---|
8 | // ######### # # # All rights reserved.
|
---|
9 | // ## ##########
|
---|
10 | // ##
|
---|
11 | //
|
---|
12 | ///////////////////////////////////////////////////////////////////////////////
|
---|
13 |
|
---|
14 | uniform vec4 tex0RcpSize;
|
---|
15 | uniform vec4 passInfo;
|
---|
16 |
|
---|
17 | varying vec2 screen;
|
---|
18 | varying vec2 scale;
|
---|
19 |
|
---|
20 | ///////////////////////////////////////////////////////////////////////////////
|
---|
21 |
|
---|
22 | void main(void)
|
---|
23 | {
|
---|
24 | // Transform position to clip space
|
---|
25 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
---|
26 |
|
---|
27 | // Smoothing parameters:
|
---|
28 | // Go from wide to small to avoid artifacts in case of depth jumps.
|
---|
29 | // Use pow(2,iter) instead of pow(3,iter),
|
---|
30 | // because this gives a better quality:
|
---|
31 | float iter = passInfo.x;
|
---|
32 | float smooth = exp2(iter);
|
---|
33 |
|
---|
34 | screen.xy = gl_MultiTexCoord0.xy;
|
---|
35 | scale.xy = tex0RcpSize.xy * smooth;
|
---|
36 | }
|
---|
37 |
|
---|
38 | ///////////////////////////////////////////////////////////////////////////////
|
---|
Note: See
TracBrowser
for help on using the repository browser.