Update render pipelines data.

This commit is contained in:
Lubos Lenco 2016-04-20 23:11:25 +02:00
parent 8d0b1f7e0b
commit 7d5bcbbb55
6 changed files with 36 additions and 75 deletions

Binary file not shown.

View file

@ -218,7 +218,7 @@ class DrawWorldNode(Node, CGPipelineTreeNode):
def free(self):
print("Removing node ", self, ", Goodbye!")
# Helper nodes
# Pass nodes
class QuadPassNode(Node, CGPipelineTreeNode):
'''A custom node'''
bl_idname = 'QuadPassNodeType'
@ -244,6 +244,23 @@ class QuadPassNode(Node, CGPipelineTreeNode):
def free(self):
print("Removing node ", self, ", Goodbye!")
# Constant nodes
class ScreeNode(Node, CGPipelineTreeNode):
'''A custom node'''
bl_idname = 'ScreenNodeType'
bl_label = 'Screen'
bl_icon = 'SOUND'
def init(self, context):
self.outputs.new('NodeSocketInt', "Width")
self.outputs.new('NodeSocketInt', "Height")
def copy(self, node):
print("Copying from node ", node)
def free(self):
print("Removing node ", self, ", Goodbye!")
### Node Categories ###
# Node categories are a python system for automatically
# extending the Add menu, toolbar panels and search operator.
@ -261,6 +278,11 @@ class MyPassNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'CGPipelineTreeType'
class MyConstantNodeCategory(NodeCategory):
@classmethod
def poll(cls, context):
return context.space_data.tree_type == 'CGPipelineTreeType'
node_categories = [
MyPipelineNodeCategory("PIPELINENODES", "Pipeline", items=[
@ -275,10 +297,13 @@ node_categories = [
NodeItem("TargetNodeType"),
NodeItem("ColorBufferNodeType"),
NodeItem("FramebufferNodeType"),
]),
]),
MyPassNodeCategory("PASSNODES", "Pass", items=[
NodeItem("QuadPassNodeType"),
]),
]),
MyConstantNodeCategory("CONSTANTNODES", "Constant", items=[
NodeItem("ScreenNodeType"),
]),
]

View file

@ -1,16 +0,0 @@
#version 450
#ifdef GL_ES
precision mediump float;
#endif
#ifdef _NMTex
#define _AMTex
#endif
in vec4 position;
void main() {
float depth = position.z / position.w;
gl_FragColor = vec4(depth, 0.0, 0.0, 1.0);
}

View file

@ -1,48 +0,0 @@
#version 450
#ifdef GL_ES
precision highp float;
#endif
#ifdef _NMTex
#define _AMTex
#endif
in vec3 pos;
in vec3 nor;
#ifdef _AMTex
in vec2 tex;
#endif
#ifdef _VCols
in vec4 col;
#endif
#ifdef _NMTex
in vec3 tan;
in vec3 bitan;
#endif
#ifdef _Skinning
in vec4 bone;
in vec4 weight;
#endif
#ifdef _Instancing
in vec3 off;
#endif
uniform mat4 M;
uniform mat4 NM;
uniform mat4 V;
uniform mat4 P;
out vec4 position;
void main() {
// #ifdef _Instancing
// gl_Position = M * vec4(pos + off, 1.0);
// #else
// gl_Position = M * vec4(pos, 1.0);
// #endif
gl_Position = P * V * M * vec4(pos, 1.0);
position = gl_Position;
}

View file

@ -65,10 +65,9 @@ in vec3 normal;
// return clamp(max(p, p_max), 0.0, 1.0);
// }
// Just for testing, unrealiable on low precisions
float rand(vec2 co) {
return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
}
// float rand(vec2 co) {
// return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
// }
float texture2DCompare(vec2 uv, float compare){
float depth = texture(shadowMap, uv).r * 2.0 - 1.0;
@ -286,7 +285,7 @@ void main() {
if (receiveShadow) {
if (lPos.w > 0.0) {
visibility = shadowTest(lPos);
// visibility = 1.0;
visibility = 1.0;
}
}
@ -297,11 +296,11 @@ void main() {
discard;
#endif
vec3 baseColor = texel.rgb;
baseColor = pow(baseColor.rgb, vec3(2.2));
#else
vec3 baseColor = matColor.rgb;
#endif
baseColor = pow(baseColor.rgb, vec3(2.2));
vec4 outColor;
if (lighting) {

View file

@ -12,11 +12,12 @@ in vec4 position;
void main() {
float depth = position.z / position.w;
// float depth = position.z / position.w;
// depth += 0.005;
// gl_FragDepth = depth;
gl_FragColor = vec4(depth, 0.0, 0.0, 1.0);
// gl_FragColor = vec4(depth, 0.0, 0.0, 1.0);
gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);
// VSM
// float dx = dFdx(depth);