Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
-- Vertex

#include "vbInputData.vert"

void main(void){
    computeData();
    VAR._normalWV = normalize(dvd_NormalMatrixWV(VAR.dvd_drawID) * dvd_Normal);

    gl_Position = vec4(dvd_ViewProjectionMatrix * VAR._vertexW).xyzz;
    gl_Position.w += 0.0001;
}

/*-- Fragment.PrePass

layout(location = 0) out vec4 _skyColour;

void main() {
    _skyColour = vec4(1.0);
}*/

-- Fragment.Display

layout(location = 0) out vec4 _skyColour;
layout(location = 1) out vec2 _normalOut;

layout(binding = TEXTURE_UNIT0) uniform samplerCubeArray texSky;

uniform bool enable_sun;
uniform vec3 sun_vector;
uniform vec3 sun_colour;

#include "utility.frag"

vec3 sunColour(){
    vec3 vert = normalize(f_in._vertexW.xyz);
    vec3 sun = normalize(sun_vector);
        
    float day_factor = max(-sun.y, 0.0);
        
    float dotv = max(dot(vert, -sun), 0.0);
    vec3  sun_colour = clamp(sun_colour*1.5, 0.0, 1.0);
    
    float pow_factor = day_factor * 225.0 + 75.0;
    float sun_factor = clamp(pow(dotv, pow_factor), 0.0, 1.0);
        
    return day_factor + sun_colour * sun_factor;
}

void main() {
    vec3 sky_colour = textureLod(texSky, vec4(VAR._vertexW.xyz, 0), 0).rgb;
    _skyColour = vec4(ToSRGB(enable_sun ? sky_colour * sunColour() : sky_colour), 1.0);
    _normalOut = packNormal(normalize(VAR._normalWV));
}

Commits for Divide-Framework/trunk/assets/shaders/GLSL/sky.glsl

Diff revisions: vs.
Revision Author Commited Message
806 Diff Diff IonutCava picture IonutCava Sun 08 Jan, 2017 22:00:48 +0000

[IonutCava]
- Finish implementing per-fragment velocity computation using a compute shader
— Further tuning still needed
- Add VS2017 build targets

795 Diff Diff IonutCava picture IonutCava Wed 23 Nov, 2016 17:14:33 +0000

[IonutCava]
- Remove ULL. Use U64 instead
- Various small bug fixes and typos.

770 Diff Diff IonutCava picture IonutCava Tue 20 Sep, 2016 16:12:27 +0000

[IonutCava]
- Prepare velocity map calculation (later used for temporal AA and motion blur):
— Add a previous depth buffer render target that blits the main depth buffer at the end of the frame
— Add a new render target to the screen FBO: velocity map
- Store normals as RG instead of RGB and pack/unpack in shaders. (compute >>>> bandwith)
- Rename Forward+ renderer to something more descriptive

(Requires deletion of all parsed & cached data)

758 Diff Diff IonutCava picture IonutCava Tue 02 Aug, 2016 16:05:09 +0000

[IonutCava]
- Added a cross platform method of naming threads (helps with debugging)
- Reduced dependency on VAR.dvd_drawID in shaders.
- Work on Single/Multi thread toggle for GFX resource loading (crashes, bugs, etc)
- Fix a bug in TaskPool where task states were never actually updated properly
- Change threadpool implementation to use std::thread instead of boost::thread

721 Diff Diff IonutCava picture IonutCava Wed 08 Jun, 2016 15:47:49 +0000

[IonutCava]
- Spelling: change all references from our code of “color” to the PROPER British version of “colour” because it sounds 100x better

624 Diff Diff IonutCava picture IonutCava Sun 17 Jan, 2016 21:03:25 +0000

[IonutCava]
- Improve multi-threaded loading System
- Fix missing pixels in logo
- Random small bug corrections

621 Diff Diff IonutCava picture IonutCava Tue 12 Jan, 2016 16:39:50 +0000

[IonutCava]
- Terrain rendering updates
- Framebuffer optimizations

617 Diff Diff IonutCava picture IonutCava Tue 05 Jan, 2016 16:47:21 +0000

[IonutCava]
- Depth writing is now a rendering API level toggle instead of a renderstateblock option
- Z-Pre-pass fixes and improvements
- Moved normal render target to the display stage from the pre-pass stage
— Normals are only used in post-processing. This improves pre-pass performance

615 Diff Diff IonutCava picture IonutCava Tue 22 Dec, 2015 16:30:42 +0000

[IonutCava]
not working properly
- Move HiZ buffer to separate render target
- Implement basic, per-scene, auto Save/Load system (works with camera position only for now)
- Fix a few wrong calls in glFramebuffer and glVertexArray
- Re-work skybox rendering

586 IonutCava picture IonutCava Thu 26 Nov, 2015 17:11:27 +0000

[IonutCava]
- Point and Directional light updates