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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef _NODE_BUFFERED_INPUT_CMN_
#define _NODE_BUFFERED_INPUT_CMN_

struct NodeData {
    mat4 _worldMatrix;
    // [0][0] ... [2][2] = normal matrix
    // [0][3] = bone count
    // [1][3] = reflection index
    // [2][3] = refraction index
    // [3][0] ... [3][3] = bounding sphere
    mat4 _normalMatrixWV;
    // [0][0] ... [0][3] = albedo
    // [1][0] ... [1][3] = specular
    // [2][0] ... [2][3] = emissive
    // [3][0] = is translucent
    // [3][1] = texture operation
    // [3][2] = texture count
    // [3][3] = parallax factor
    mat4 _colourMatrix;
    // x = selection flag
    // y = is shadow received
    // z = lod level
    // w = occlusion flag
    vec4 _properties;
};

layout(binding = BUFFER_NODE_INFO, std430) coherent readonly buffer dvd_MatrixBlock
{
    NodeData dvd_Matrices[MAX_VISIBLE_NODES];
};

mat4 dvd_WorldMatrix(in uint index) {
    return dvd_Matrices[index]._worldMatrix;
}

mat4 dvd_WorldViewMatrix(in uint index) {
    return dvd_ViewMatrix * dvd_WorldMatrix(index);
}

mat3 dvd_NormalMatrixWV(in uint index) {
    return mat3(dvd_Matrices[index]._normalMatrixWV);
}

ivec4 dvd_BufferIntegerValues(in uint index) {
    return ivec4(dvd_Matrices[index]._properties);
}


#if defined(VERT_SHADER)
#define dvd_boneCount     uint(dvd_Matrices[VAR.dvd_instanceID]._normalMatrixWV[0][3])
#endif

// x - isSelected/isHighlighted; y - isShadowMapped; z - lodLevel, w - occlusion cull data
#define dvd_lodLevel(X) dvd_BufferIntegerValues(X).z
#define dvd_customData dvd_Matrices[VAR.dvd_instanceID]._properties.w
#define dvd_reflectionIndex uint(dvd_Matrices[VAR.dvd_instanceID]._normalMatrixWV[1][3])
#define dvd_refractionIndex uint(dvd_Matrices[VAR.dvd_instanceID]._normalMatrixWV[2][3])

#if defined(FRAG_SHADER)
// x - useAlphaTest; y - textureOperation; z - parallax/relief mapping factor, w - reserved
#define buffer_matProperties dvd_Matrices[VAR.dvd_instanceID]._colourMatrix[3]

#define dvd_isSelected     (dvd_BufferIntegerValues(VAR.dvd_instanceID).x < -0.5)
#define dvd_isHighlighted  (dvd_BufferIntegerValues(VAR.dvd_instanceID).x >  0.5)
#define dvd_shadowMapping  (dvd_BufferIntegerValues(VAR.dvd_instanceID).y > 0.0)
#define dvd_useAlphaTest   (buffer_matProperties.x > 0.0)
#define dvd_texOperation   uint(buffer_matProperties.y)
#define dvd_parallaxFactor buffer_matProperties.z
#define dvd_reliefFactor   dvd_parallaxFactor

#endif

#endif //_NODE_BUFFERED_INPUT_CMN_

Commits for Divide-Framework/trunk/assets/shaders/GLSL/common/nodeBufferedInput.cmn

Diff revisions: vs.
Revision Author Commited Message
888 Diff Diff IonutCava picture IonutCava Mon 03 Apr, 2017 20:04:19 +0000

[IonutCava]
- Terrain <-> Water body collision checking for caustics

880 Diff Diff IonutCava picture IonutCava Mon 20 Mar, 2017 17:27:13 +0000

[IonutCava]
- New tessellated terrain system based on this: http://victorbush.com/2015/01/tessellated-terrain/
— Work in progress: hardcoded values, new code is in Test namespace
- Split terrain geometry in two:
— tessellated rendering data
— physics verts + indices (used for collisions, vegetation, etc)
- Old Chunk system is used only for culling objects and speeding up collision detection

879 Diff Diff IonutCava picture IonutCava Sun 19 Mar, 2017 19:29:46 +0000

[IonutCava]
- GLSL updates:
— Interface block correction to support tessellation shaders automatically
— Fixed line counting issues with the preprocessor

800 Diff Diff IonutCava picture IonutCava Fri 25 Nov, 2016 17:04:02 +0000

[IonutCava]
- More profile-guided optimizations
- Added GLSL normal map blending methods from: http://blog.selfshadow.com/sandbox/normals.html
- Added more profile timers

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

756 Diff Diff IonutCava picture IonutCava Fri 29 Jul, 2016 16:09:29 +0000

[IonutCava]
- Cleaned up material shader:
— Add explicit functions for material colour properties
— Separate Phong from PBR
— Remove texture count variable and use TEX_OPERATION_NONE for single texture
- Added a Shader compute queue that all materials share. This allows better frame time allocation for shader compilation
- Attempt to fix Task and TaskPool race conditions

749 Diff Diff IonutCava picture IonutCava Mon 04 Jul, 2016 16:01:34 +0000

[IonutCava]
- Added initial environment mapping code:
— Allow adding, per scene, of multiple environment probes that generate cube map reflections
— Support 2 types of probes: infinite (such as sky only probes) and local. Local probes use an AABB that will later be used for parallax correction
— Probes are held in a scene specific pool, can be updated at different rates and their results can be passed on to materials (if materials don’t need specific reflection systems such as for water or mirrors)
- ToDo:
— Blend between probes (currently, only the closes one is selected)
— Reduce VRAM usage
— Set as fallback for screen space reflections

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

630 Diff Diff IonutCava picture IonutCava Fri 22 Jan, 2016 17:15:44 +0000

[IonutCava]
- Improve reflection generation system
— Still buggy
- Investigate occlusion culling issue
— Still buggy
- Improve threadpool idle time using main app time and conservative thread sleep calls

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

[IonutCava]
- Point and Directional light updates