|
Last change
on this file since 12091 was
12091,
checked in by wiesep, 7 years ago
|
|
Updated programs and adjusted Material to work with GLSL>150
|
|
File size:
525 bytes
|
| Line | |
|---|
| 1 | #version 100 |
|---|
| 2 | precision highp int; |
|---|
| 3 | precision highp float; |
|---|
| 4 | |
|---|
| 5 | uniform mat4 worldViewProj; |
|---|
| 6 | uniform vec4 texelOffsets; |
|---|
| 7 | uniform vec4 depthRange; |
|---|
| 8 | |
|---|
| 9 | varying vec2 depth; |
|---|
| 10 | |
|---|
| 11 | attribute vec4 position; |
|---|
| 12 | |
|---|
| 13 | void main() |
|---|
| 14 | { |
|---|
| 15 | gl_Position = worldViewProj * position; |
|---|
| 16 | |
|---|
| 17 | // fix pixel / texel alignment |
|---|
| 18 | gl_Position.xy += texelOffsets.zw * gl_Position.w; |
|---|
| 19 | // linear depth storage |
|---|
| 20 | // offset / scale range output |
|---|
| 21 | #if LINEAR_RANGE |
|---|
| 22 | depth.x = (gl_Position.z - depthRange.x) * depthRange.w; |
|---|
| 23 | #else |
|---|
| 24 | depth.x = gl_Position.z; |
|---|
| 25 | #endif |
|---|
| 26 | depth.y = gl_Position.w; |
|---|
| 27 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.