-
-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new blenders to support Indirect Lighting, and later to support B…
…eef's NVG shaders
- Loading branch information
Showing
18 changed files
with
627 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "common.h" | ||
|
||
////////////////////////////////////////////////////////////////////////////////////////// | ||
// Vertex | ||
p_screen main(v2p_screen I) | ||
{ | ||
p_screen O; | ||
// Transform to screen space (in d3d9 it was done automatically) | ||
O.hpos.x = (I.HPos.x * screen_res.z * 2 - 1); | ||
O.hpos.y = -(I.HPos.y * screen_res.w * 2 - 1); | ||
O.hpos.zw = I.HPos.zw; | ||
|
||
O.tc0 = I.tc0; | ||
|
||
return O; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#include "stdafx.h" | ||
|
||
#include "blender_dof.h" | ||
|
||
CBlender_dof::CBlender_dof() | ||
{ | ||
description.CLS = B_BLUR; | ||
} | ||
|
||
LPCSTR CBlender_dof::getComment() | ||
{ | ||
return "INTERNAL: dof"; | ||
} | ||
|
||
void CBlender_dof::Compile(CBlender_Compile& C) | ||
{ | ||
IBlender::Compile(C); | ||
#if RENDER == R_R4 | ||
switch (C.iElement) | ||
{ | ||
case 0: | ||
C.r_Pass("stub_screen_space", "depth_of_field", FALSE, FALSE, FALSE); | ||
C.r_dx11Texture("s_position", r2_RT_P); | ||
C.r_dx11Texture("s_image", r2_RT_generic0); | ||
C.r_dx11Texture("s_blur_2", r2_RT_blur_2); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_End(); | ||
break; | ||
case 1: | ||
C.r_Pass("stub_screen_space", "post_processing", FALSE, FALSE, FALSE); | ||
C.r_dx11Texture("samplero_pepero", r2_RT_dof); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_End(); | ||
break; | ||
} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
class CBlender_dof : public IBlender | ||
{ | ||
public: | ||
CBlender_dof(); | ||
~CBlender_dof() override = default; | ||
|
||
LPCSTR getComment() override; | ||
void Compile(CBlender_Compile& C) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#include "stdafx.h" | ||
|
||
#include "blender_nightvision.h" | ||
|
||
|
||
CBlender_nightvision::CBlender_nightvision() | ||
{ | ||
description.CLS = B_BLUR; | ||
} | ||
|
||
LPCSTR CBlender_nightvision::getComment() | ||
{ | ||
return "INTERNAL: beef's nightvision"; | ||
} | ||
|
||
void CBlender_nightvision::Compile(CBlender_Compile& C) | ||
{ | ||
IBlender::Compile(C); | ||
#if RENDER == R_R4 | ||
switch (C.iElement) | ||
{ | ||
case 0: //Dummy shader - because IDK what gonna happen when r2_nightvision will be 0 | ||
C.r_Pass("stub_screen_space", "copy_nomsaa", FALSE, FALSE, FALSE); | ||
C.r_dx11Texture("s_generic", r2_RT_generic0); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_End(); | ||
break; | ||
case 1: | ||
C.r_Pass("stub_screen_space", "nightvision_gen_1", FALSE, FALSE, FALSE); | ||
C.r_dx11Texture("s_position", r2_RT_P); | ||
C.r_dx11Texture("s_image", r2_RT_generic0); | ||
//C.r_dx11Texture("s_bloom_new", r2_RT_pp_bloom); | ||
C.r_dx11Texture("s_blur_2", r2_RT_blur_2); | ||
C.r_dx11Texture("s_blur_4", r2_RT_blur_4); | ||
C.r_dx11Texture("s_blur_8", r2_RT_blur_8); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_End(); | ||
break; | ||
case 2: | ||
C.r_Pass("stub_screen_space", "nightvision_gen_2", FALSE, FALSE, FALSE); | ||
C.r_dx11Texture("s_position", r2_RT_P); | ||
C.r_dx11Texture("s_image", r2_RT_generic0); | ||
//C.r_dx11Texture("s_bloom_new", r2_RT_pp_bloom); | ||
C.r_dx11Texture("s_blur_2", r2_RT_blur_2); | ||
C.r_dx11Texture("s_blur_4", r2_RT_blur_4); | ||
C.r_dx11Texture("s_blur_8", r2_RT_blur_8); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_End(); | ||
break; | ||
case 3: | ||
C.r_Pass("stub_screen_space", "nightvision_gen_3", FALSE, FALSE, FALSE); | ||
C.r_dx11Texture("s_position", r2_RT_P); | ||
C.r_dx11Texture("s_image", r2_RT_generic0); | ||
//C.r_dx11Texture("s_bloom_new", r2_RT_pp_bloom); | ||
C.r_dx11Texture("s_blur_2", r2_RT_blur_2); | ||
C.r_dx11Texture("s_blur_4", r2_RT_blur_4); | ||
C.r_dx11Texture("s_blur_8", r2_RT_blur_8); | ||
|
||
C.r_dx11Sampler("smp_base"); | ||
C.r_dx11Sampler("smp_nofilter"); | ||
C.r_dx11Sampler("smp_rtlinear"); | ||
C.r_End(); | ||
break; | ||
} | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
class CBlender_nightvision : public IBlender | ||
{ | ||
public: | ||
CBlender_nightvision(); | ||
~CBlender_nightvision() override = default; | ||
|
||
LPCSTR getComment() override; | ||
void Compile(CBlender_Compile& C) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.