More D3D fixes

This commit is contained in:
luboslenco 2017-04-19 23:11:02 +02:00
parent 68b74a95c1
commit 71e9cce396
12 changed files with 44 additions and 1 deletions

View file

@ -18,7 +18,11 @@ out vec2 texCoord;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -18,7 +18,11 @@ out vec2 texCoord;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -10,7 +10,11 @@ out vec2 texCoord;
void main() {
// Scale vertex attribute to 0-1 range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -14,7 +14,11 @@ out vec3 viewRay;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -13,7 +13,11 @@ out vec3 viewRay;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -16,7 +16,11 @@ out vec2 texCoord;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
initialRay = mix(mix(ray00, ray01, texCoord.y), mix(ray10, ray11, texCoord.y), texCoord.x);
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -19,7 +19,11 @@ const int SMAA_MAX_SEARCH_STEPS = 16;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
// Blend Weight Calculation Vertex Shader

View file

@ -15,7 +15,11 @@ out vec4 offset2;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
// Edge Detection Vertex Shader

View file

@ -13,7 +13,11 @@ out vec4 offset;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
// Neighborhood Blending Vertex Shader

View file

@ -17,7 +17,11 @@ out vec3 vecnormal;
void main() {
// Scale vertex attribute to [0-1] range
#ifdef _InvY
const vec2 madd = vec2(0.5, -0.5);
#else
const vec2 madd = vec2(0.5, 0.5);
#endif
texCoord = pos.xy * madd + madd;
gl_Position = vec4(pos.xy, 0.0, 1.0);

View file

@ -97,6 +97,9 @@ def build_node_tree(world):
wrd.world_defs += '_Rad' # Always do radiance for voxels
wrd.world_defs += '_Irr'
if arm.utils.get_gapi().startswith('direct3d'): # Flip Y axis in drawQuad command
wrd.world_defs += '_InvY'
# Area lamps
for lamp in bpy.data.lamps:
if lamp.type == 'AREA':

View file

@ -15,7 +15,7 @@ def make(context_id, rpasses):
tesc = None
tese = None
if arm.utils.get_gapi() == 'arm_direct3d9':
if arm.utils.get_gapi() == 'direct3d9':
frag.add_out('vec4 fragColor') # Definition requred for d3d9 - pixel shader must minimally write all four components of COLOR0
vert.write_main_header('vec4 spos = vec4(pos, 1.0);')