Bo3b's School For Shaderhackers
  84 / 88    
OK Guys nvm I figured it out and it is working now.. thnx for letting me vent ..!! Looks like I need no vive yet..
OK Guys nvm I figured it out and it is working now.. thnx for letting me vent ..!!

Looks like I need no vive yet..

Intel i5 7600K @ 4.8ghz / MSI Z270 SLI / Asus 1080GTX - 416.16 / Optoma HD142x Projector / 1 4'x10' Curved Screen PVC / TrackIR / HOTAS Cougar / Cougar MFD's / Track IR / NVidia 3D Vision / Win 10 64bit

Posted 11/14/2018 03:50 AM   
hello, is it possible to create a custom resource and initialize it in d3dx.ini (that is a vector of 8 float values) ? I used all variable for different functions of my mod and I would like to not put parameters in shader files but keeps them in d3dx.ini...
hello, is it possible to create a custom resource and initialize it in d3dx.ini (that is a vector of 8 float values) ?
I used all variable for different functions of my mod and I would like to not put parameters in shader files but keeps them in d3dx.ini...

Posted 11/19/2018 09:35 PM   
Yes. There are several options for doing this, and keep an eye out in the release notes in the coming versions of 3DMigoto for quality of life improvements in this area, potentially including allowing these to be partially updated via command lists in a similar way to IniParams - at the moment if you want to update one of these buffers you either need to do it from a compute/pixel shader on the GPU (examples below) or swap the entire buffer out for another (the DOAXVV help text shader does this, and note that it often necessitates specifying bind_flags, which I've omitted from the below examples). e.g. Declaring a buffer that is an array of float4s with constant data: [code] [ResourceSimpleTypedBuffer] type = Buffer format = R32G32B32A32_FLOAT data = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [/code] When you want to use it just bind it, like: [code] [ShaderOverrideFoo] hash = applejack ps-t100 = ResourceSimpleTypedBuffer post ps-t100 = null [/code] Here I'm unbinding it afterwards. If the game ever uses the slot you should back up and restore the original instead, but t100 is generally high enough to be safe so I'm mostly doing that in case I wish to use it as an output somewhere else, which I do in some of the below examples. e.g. Declaring a buffer containing the text "Shadows: Original" as an array of bytes for consumption by the help text shader (DOAXVV): [code] [ResourceShadowsOrig] type = Buffer format = R8_UINT data = 83 104 97 100 111 119 115 58 32 79 114 105 103 105 110 97 108 [/code] e.g. As above, but loading the buffer from a file on disk instead of specifying data=. This is quite a bit nicer for text since you can just use notepad, and while you can do this for any other format you need to construct the file as binary, so data= is generally nicer for floats, integers, etc: [code] [ResourceHelpFull] type = buffer format = R8_UINT filename = help.txt [/code] e.g. Declaring a structured buffer with initial data (from the help text shader in DOAXVV - this defines where the text is to be displayed on screen). Note that above format= was on a separate line, while here the format is specified as the first parameter in data=, which is a necessary quirk for StructuredBuffers as they cannot have an official format, but you still need a way to indicate how the data= line should be interpreted: [code] [ResourceParamsShort] type = StructuredBuffer array = 1 data = R32_FLOAT -0.93 -0.9 +1 -0.9 1 0.7 0.15 1 0 0 0 0.75 0.01 0.01 1 3 1 1.0 ; ^Bounds Rectangle^|^^^Colour^^^|Background|^Border^^|^ ^|^|^-- font scale ; x1 y1 x2 y2 |r g b a|r g b a |horz vert| ^ |^---- text alignment: 0=left 1=center 2=right ; range -1:+1 | | | | ^--- h/v-anchor: 0=none 1=left/top 2=center 3=right/bottom [/code] Binding both the above to the geometry and pixel custom shaders running on the present call: [code] [Present] ... gs-t113 = ResourceShadowsOrig gs-t114 = ResourceParamsShort ps-t114 = ResourceParamsShort run = CustomShaderRenderText gs-t113 = null gs-t114 = null ps-t114 = null ... [/code] Defining both of the above in the shader: [code] Buffer<uint> text : register(t113); struct TextParameters { float4 rect; float4 colour; float4 background; float2 border; float h_anchor; float v_anchor; float h_align; float font_scale; }; StructuredBuffer<TextParameters> params : register(t114); [/code] Accessing both buffers in the shader: [code] uint pos; uint c; float2 cur_pos; ... for (pos = 0; c = text[pos]; pos++) { ... cur_pos.x += ... params[0].font_scale; [/code] e.g. Declaring a structured buffer that is to be altered on the GPU by a compute or pixel shader (I may later add support for updating these from other shader types, however that breaks compatibility on Windows 7 where KB 2670838 has not been installed. Other shaders can still access it as a read only buffer by binding it to a t register and so long as it is not also simultaneously bound to a u register elsewhere) from Dreamfall Chapters. Since no initial data is specified you must indicate the size of the buffer via stride (size of each individual data structure in bytes) and array (number of structures in the buffer): [code] [Resource_HUD_Info_UAV] type = RWStructuredBuffer ; Stride must be set to sizeof(struct hud_info) stride = 96 array = 1 [CustomShader_HUD_Analyse] cs = ShaderFixes/hud_analyse.hlsl cs-u0 = Resource_HUD_Info_UAV post cs-u0 = null Dispatch = 1, 1, 1 [/code] Similar to above, this time a RWStructuredBuffer that can be altered on the GPU but also with an initialiser: [code] [ResourceAutoConvergenceState] ; This buffer holds some state that the auto-convergence shader uses to try to ; counter unwanted judder in some (literal) edge cases, and other things. type = RWStructuredBuffer ; ; data= sets the initial state of the buffer - the size of the buffer is ; automatically calculated from this, offering an alternative to manually ; specifying stride and array - for a structured buffer stride will be set to ; the buffer size, and array will be 1. ; ; Specifying the format inline here instead of in a separate format= line makes ; it only apply to parsing this line, leaving the actual buffer format as ; UNKNOWN, which is necessary for structured buffers. ; ; Pass hex literalls for parameters that aren't floats, e.g. You can stop the ; auto-convergence HUD from showing up on launch by changing the initial state ; of prev_auto_convergence_enabled (8th field, a boolean) to 0xffffffff. ; ; 0x7fc00000 is "nan", signifying that 3DMigoto did not set the convergence ; last frame. When we switch 3DMigoto to the vs2015 branch we will be able to ; just write "nan" here instead. data = R32_FLOAT 0 0 0 0 0 0 0 0x00000000 0 0x7fc00000 [/code]
Yes. There are several options for doing this, and keep an eye out in the release notes in the coming versions of 3DMigoto for quality of life improvements in this area, potentially including allowing these to be partially updated via command lists in a similar way to IniParams - at the moment if you want to update one of these buffers you either need to do it from a compute/pixel shader on the GPU (examples below) or swap the entire buffer out for another (the DOAXVV help text shader does this, and note that it often necessitates specifying bind_flags, which I've omitted from the below examples).

e.g. Declaring a buffer that is an array of float4s with constant data:

[ResourceSimpleTypedBuffer]
type = Buffer
format = R32G32B32A32_FLOAT
data = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

When you want to use it just bind it, like:

[ShaderOverrideFoo]
hash = applejack
ps-t100 = ResourceSimpleTypedBuffer
post ps-t100 = null

Here I'm unbinding it afterwards. If the game ever uses the slot you should back up and restore the original instead, but t100 is generally high enough to be safe so I'm mostly doing that in case I wish to use it as an output somewhere else, which I do in some of the below examples.

e.g. Declaring a buffer containing the text "Shadows: Original" as an array of bytes for consumption by the help text shader (DOAXVV):

[ResourceShadowsOrig]
type = Buffer
format = R8_UINT
data = 83 104 97 100 111 119 115 58 32 79 114 105 103 105 110 97 108

e.g. As above, but loading the buffer from a file on disk instead of specifying data=. This is quite a bit nicer for text since you can just use notepad, and while you can do this for any other format you need to construct the file as binary, so data= is generally nicer for floats, integers, etc:

[ResourceHelpFull]
type = buffer
format = R8_UINT
filename = help.txt

e.g. Declaring a structured buffer with initial data (from the help text shader in DOAXVV - this defines where the text is to be displayed on screen). Note that above format= was on a separate line, while here the format is specified as the first parameter in data=, which is a necessary quirk for StructuredBuffers as they cannot have an official format, but you still need a way to indicate how the data= line should be interpreted:

[ResourceParamsShort]
type = StructuredBuffer
array = 1
data = R32_FLOAT -0.93 -0.9 +1 -0.9 1 0.7 0.15 1 0 0 0 0.75 0.01 0.01 1 3 1 1.0
; ^Bounds Rectangle^|^^^Colour^^^|Background|^Border^^|^ ^|^|^-- font scale
; x1 y1 x2 y2 |r g b a|r g b a |horz vert| ^ |^---- text alignment: 0=left 1=center 2=right
; range -1:+1 | | | | ^--- h/v-anchor: 0=none 1=left/top 2=center 3=right/bottom

Binding both the above to the geometry and pixel custom shaders running on the present call:

[Present]
...
gs-t113 = ResourceShadowsOrig
gs-t114 = ResourceParamsShort
ps-t114 = ResourceParamsShort
run = CustomShaderRenderText
gs-t113 = null
gs-t114 = null
ps-t114 = null
...

Defining both of the above in the shader:

Buffer<uint> text : register(t113);

struct TextParameters {
float4 rect;
float4 colour;
float4 background;
float2 border;
float h_anchor;
float v_anchor;
float h_align;
float font_scale;
};
StructuredBuffer<TextParameters> params : register(t114);

Accessing both buffers in the shader:

uint pos;
uint c;
float2 cur_pos;
...
for (pos = 0; c = text[pos]; pos++) {
...
cur_pos.x += ... params[0].font_scale;

e.g. Declaring a structured buffer that is to be altered on the GPU by a compute or pixel shader (I may later add support for updating these from other shader types, however that breaks compatibility on Windows 7 where KB 2670838 has not been installed. Other shaders can still access it as a read only buffer by binding it to a t register and so long as it is not also simultaneously bound to a u register elsewhere) from Dreamfall Chapters. Since no initial data is specified you must indicate the size of the buffer via stride (size of each individual data structure in bytes) and array (number of structures in the buffer):

[Resource_HUD_Info_UAV]
type = RWStructuredBuffer
; Stride must be set to sizeof(struct hud_info)
stride = 96
array = 1

[CustomShader_HUD_Analyse]
cs = ShaderFixes/hud_analyse.hlsl
cs-u0 = Resource_HUD_Info_UAV
post cs-u0 = null
Dispatch = 1, 1, 1

Similar to above, this time a RWStructuredBuffer that can be altered on the GPU but also with an initialiser:

[ResourceAutoConvergenceState]
; This buffer holds some state that the auto-convergence shader uses to try to
; counter unwanted judder in some (literal) edge cases, and other things.
type = RWStructuredBuffer
;
; data= sets the initial state of the buffer - the size of the buffer is
; automatically calculated from this, offering an alternative to manually
; specifying stride and array - for a structured buffer stride will be set to
; the buffer size, and array will be 1.
;
; Specifying the format inline here instead of in a separate format= line makes
; it only apply to parsing this line, leaving the actual buffer format as
; UNKNOWN, which is necessary for structured buffers.
;
; Pass hex literalls for parameters that aren't floats, e.g. You can stop the
; auto-convergence HUD from showing up on launch by changing the initial state
; of prev_auto_convergence_enabled (8th field, a boolean) to 0xffffffff.
;
; 0x7fc00000 is "nan", signifying that 3DMigoto did not set the convergence
; last frame. When we switch 3DMigoto to the vs2015 branch we will be able to
; just write "nan" here instead.
data = R32_FLOAT 0 0 0 0 0 0 0 0x00000000 0 0x7fc00000

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/20/2018 12:54 AM   
I'm lost but amazed by your knowledge... I wonder what nvidia is waiting to hire you.
I'm lost but amazed by your knowledge... I wonder what nvidia is waiting to hire you.

3D Vision must live! NVIDIA, don't let us down!

Posted 11/20/2018 03:25 AM   
Amazing. What I want to do the most is real automatic convergence for Dragon Ball FighterZ. It has to quickly react when characters are close to the camera (ultimate attacks). Most of them really need low convergence, but there isn't any special shader there or missing that can identify the situation. I need to do what you did in Before the Storm.
Amazing. What I want to do the most is real automatic convergence for Dragon Ball FighterZ. It has to quickly react when characters are close to the camera (ultimate attacks). Most of them really need low convergence, but there isn't any special shader there or missing that can identify the situation.

I need to do what you did in Before the Storm.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 11/20/2018 08:49 AM   
Many thanks for this complete answer. I already use a compute shader to set up a resource, but I did not find a reference to the data line. By the way I did not manage to use a if..endif structure in a [key] section, and is it possible to set up a resource using a data line in a [key] section ?
Many thanks for this complete answer. I already use a compute shader to set up a resource, but I did not find a reference to the data line.
By the way I did not manage to use a if..endif structure in a [key] section, and is it possible to set up a resource using a data line in a [key] section ?

Posted 11/22/2018 09:11 PM   
The [Key] sections aren't command lists (and there's some conflicting syntax so I can't turn them into command lists without some weird and wonderful differences in behaviour that I'd rather avoid), but they can call a command list to do what you want, e.g. from DOAXVV I use this to display text when enabling/disabling mods: [code] [KeyToggleMods] Key = no_modifiers F2 z = 0 type = toggle run = CommandListToggleMods [CommandListToggleMods] pre Resource\ShaderFixes\help.ini\Notification = ref ResourceCostumeModsDisabled pre run = CustomShader\ShaderFixes\help.ini\FormatText pre z5 = time + 2.0 post Resource\ShaderFixes\help.ini\Notification = ref ResourceCostumeModsEnabled post run = CustomShader\ShaderFixes\help.ini\FormatText post z5 = time + 2.0 [/code] If the key is a type=hold or type=toggle the command list's pre phase will be invoked when the key is pressed the first time, and the post phase will be invoked when the key is released/pressed the second time - you can see above I use that to display different text for enable vs disable. Most commands defaults to pre if you don't explicitly say which you want, though a few things (like calling other command lists) default to both pre and post - the default behaviour generally tries to be "sensible", for my definition of sensible ;-) I should probably add a "both" keyword where both "pre" and "post" are explicitly wanted, which would have eliminated two lines in my above example. If it's just a normal key binding or type=cycle the post phase will be invoked immediately after the pre phase.
The [Key] sections aren't command lists (and there's some conflicting syntax so I can't turn them into command lists without some weird and wonderful differences in behaviour that I'd rather avoid), but they can call a command list to do what you want, e.g. from DOAXVV I use this to display text when enabling/disabling mods:

[KeyToggleMods]
Key = no_modifiers F2
z = 0
type = toggle
run = CommandListToggleMods

[CommandListToggleMods]
pre Resource\ShaderFixes\help.ini\Notification = ref ResourceCostumeModsDisabled
pre run = CustomShader\ShaderFixes\help.ini\FormatText
pre z5 = time + 2.0
post Resource\ShaderFixes\help.ini\Notification = ref ResourceCostumeModsEnabled
post run = CustomShader\ShaderFixes\help.ini\FormatText
post z5 = time + 2.0


If the key is a type=hold or type=toggle the command list's pre phase will be invoked when the key is pressed the first time, and the post phase will be invoked when the key is released/pressed the second time - you can see above I use that to display different text for enable vs disable. Most commands defaults to pre if you don't explicitly say which you want, though a few things (like calling other command lists) default to both pre and post - the default behaviour generally tries to be "sensible", for my definition of sensible ;-)

I should probably add a "both" keyword where both "pre" and "post" are explicitly wanted, which would have eliminated two lines in my above example.

If it's just a normal key binding or type=cycle the post phase will be invoked immediately after the pre phase.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/23/2018 03:50 AM   
Unfortunately, I had the same problem with "pre" than with [key] : it looks like I can not add an "if" in it... Another thing : I tried to use an "include" command to have in a file the following resources declaration: [code][ResourceKneepadCoord] type = StructuredBuffer array = 1 data = R32_FLOAT +0.0 +0.5 +0.1 +0.9 +0.1 +0.8 +0.2 +1.0 ; ^Kneepad in non VR^|^Kneepad in VR ^| ; Xmin Xmax Ymin Ymax |Xmin Xmax Ymin Ymax ; coordinates from upper left corner of screen in 2D and HUD area in VR ; range from 0 ( left or up) to 1.0 (right of down)[/code] But this resource can not be use in d3dx.ini...
Unfortunately, I had the same problem with "pre" than with [key] : it looks like I can not add an "if" in it...
Another thing : I tried to use an "include" command to have in a file the following resources declaration:
[ResourceKneepadCoord]
type = StructuredBuffer
array = 1
data = R32_FLOAT +0.0 +0.5 +0.1 +0.9 +0.1 +0.8 +0.2 +1.0
; ^Kneepad in non VR^|^Kneepad in VR ^|
; Xmin Xmax Ymin Ymax |Xmin Xmax Ymin Ymax
; coordinates from upper left corner of screen in 2D and HUD area in VR
; range from 0 ( left or up) to 1.0 (right of down)

But this resource can not be use in d3dx.ini...

Posted 11/25/2018 05:40 PM   
[quote="lefuneste"]Unfortunately, I had the same problem with "pre" than with [key] : it looks like I can not add an "if" in it...[/quote]I'll take a look at that later and see if we have a bug there. [quote]Another thing : I tried to use an "include" command to have in a file the following resources declaration: [code][ResourceKneepadCoord][/code] But this resource can not be use in d3dx.ini... [/quote]Resources outside of the d3dx.ini get namespaced to avoid conflicts, and to refer to them outside of the file they are defined in you need to use the full namespace, like: [code]Resouce\ShaderFixes\foo.ini\KneepadCoord[/code]
lefuneste said:Unfortunately, I had the same problem with "pre" than with [key] : it looks like I can not add an "if" in it...
I'll take a look at that later and see if we have a bug there.

Another thing : I tried to use an "include" command to have in a file the following resources declaration:
[ResourceKneepadCoord]

But this resource can not be use in d3dx.ini...
Resources outside of the d3dx.ini get namespaced to avoid conflicts, and to refer to them outside of the file they are defined in you need to use the full namespace, like:

Resouce\ShaderFixes\foo.ini\KneepadCoord

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/26/2018 03:07 AM   
Thanks. Still another question : for my IL2 mod I am making a "mask" to hide labels by cockpit & airframe. I modify Pixel shader to add an output (o7), but I would like to chain a dedicated PS shader instead of modying existing ones. It would be easier to maintain, because there are often game updtate that change shaders and I then have to modify them again. The problem is that when I try to chain a PS either to the VS or to one PS, the original PS output are disabled. Is the only solution to copy / restore o0 before calling the dedicated PS writing o7 ?
Thanks.
Still another question : for my IL2 mod I am making a "mask" to hide labels by cockpit & airframe. I modify Pixel shader to add an output (o7), but I would like to chain a dedicated PS shader instead of modying existing ones. It would be easier to maintain, because there are often game updtate that change shaders and I then have to modify them again.
The problem is that when I try to chain a PS either to the VS or to one PS, the original PS output are disabled. Is the only solution to copy / restore o0 before calling the dedicated PS writing o7 ?

Posted 11/30/2018 12:28 PM   
When you use a [CustomShader] section 3DMigoto will automatically back up and restore all render targets (o0 through o7), UAVs bound to a pixel shader (ps-u1 through ps-u7) and the depth target (oD), as well as various aspects of the pipeline state, so you don't have to do this manually (mostly it's only textures you need to back up and restore, and even then you can sometimes get away without it). I'm not sure what you mean by the original PS outputs being disabled? 3DMigoto doesn't automatically unbind the existing render targets, because you might want to use them - however, DirectX has it's own set of restrictions as to what may be bound in the pipeline and if you are violating one of those things will go pear shaped. For render targets it's important to make sure that they are not also bound as an input (like ps-t100) somewhere else, and that they match the width, height and msaa level of any other render or depth targets still bound - "run = BuiltInCommandListUnbindAllRenderTargets" is provided as a convenient shortcut to make sure there are no other potentially incompatible render/depth targets bound, though if you know your render target's size matches o0 (e.g. because you used "ResourceFoo = copy_desc o0" immediately beforehand) you can skip that.
When you use a [CustomShader] section 3DMigoto will automatically back up and restore all render targets (o0 through o7), UAVs bound to a pixel shader (ps-u1 through ps-u7) and the depth target (oD), as well as various aspects of the pipeline state, so you don't have to do this manually (mostly it's only textures you need to back up and restore, and even then you can sometimes get away without it).

I'm not sure what you mean by the original PS outputs being disabled? 3DMigoto doesn't automatically unbind the existing render targets, because you might want to use them - however, DirectX has it's own set of restrictions as to what may be bound in the pipeline and if you are violating one of those things will go pear shaped. For render targets it's important to make sure that they are not also bound as an input (like ps-t100) somewhere else, and that they match the width, height and msaa level of any other render or depth targets still bound - "run = BuiltInCommandListUnbindAllRenderTargets" is provided as a convenient shortcut to make sure there are no other potentially incompatible render/depth targets bound, though if you know your render target's size matches o0 (e.g. because you used "ResourceFoo = copy_desc o0" immediately beforehand) you can skip that.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/30/2018 02:41 PM   
IRacing got a new weather engine the clouds now moving but they are in 2D This i think is the corresponding Vertex shader: [code]// ---- Created with 3Dmigoto v1.3.1 on Sat Dec 08 01:08:24 2018 cbuffer skyCloud : register(b0) { float4 cloudAltRange : packoffset(c0); float4 cloudLight : packoffset(c1); float4 cloudParams : packoffset(c2); float4 cloudNoise1Scale : packoffset(c3); float4 cloudNoise1Bias : packoffset(c4); float4 cloudNoise2Scale : packoffset(c5); float4 cloudNoise2Bias : packoffset(c6); float4 cloudLODControl : packoffset(c7); float4 cloudControlOffset : packoffset(c8); float4 cloudNoise1Offset : packoffset(c9); float4 cloudNoise2Offset : packoffset(c10); float4 cloudDensity : packoffset(c11); float4 cloudParams2 : packoffset(c12); float4 cloudParams3 : packoffset(c13); float4 cloudParams4 : packoffset(c14); float4 cloudParams5 : packoffset(c15); float4 cloudParams6 : packoffset(c16); float4 skySliceInfo : packoffset(c17); float4 cloudLightSteps[8] : packoffset(c18); } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : POSITION0, float2 v1 : TEXCOORD0, out float2 o0 : TEXCOORD0, out float4 o1 : SV_POSITION0) { float4 r0; uint4 bitmask, uiDest; float4 fDest; r0.xy = skySliceInfo.yw + -skySliceInfo.xz; o0.xy = v1.xy * r0.xy + skySliceInfo.xz; o1.xyzw = v0.xyzw; //float4 params = IniParams.Load(0); This is working but the result seems not quite right //float4 stereo = StereoParams.Load(0); //o1.x+=stereo.x*stereo.y; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 10.1[/code] Maybe theres a better formula to fix this?
IRacing got a new weather engine the clouds now moving but they are in 2D
This i think is the corresponding Vertex shader:
// ---- Created with 3Dmigoto v1.3.1 on Sat Dec 08 01:08:24 2018

cbuffer skyCloud : register(b0)
{
float4 cloudAltRange : packoffset(c0);
float4 cloudLight : packoffset(c1);
float4 cloudParams : packoffset(c2);
float4 cloudNoise1Scale : packoffset(c3);
float4 cloudNoise1Bias : packoffset(c4);
float4 cloudNoise2Scale : packoffset(c5);
float4 cloudNoise2Bias : packoffset(c6);
float4 cloudLODControl : packoffset(c7);
float4 cloudControlOffset : packoffset(c8);
float4 cloudNoise1Offset : packoffset(c9);
float4 cloudNoise2Offset : packoffset(c10);
float4 cloudDensity : packoffset(c11);
float4 cloudParams2 : packoffset(c12);
float4 cloudParams3 : packoffset(c13);
float4 cloudParams4 : packoffset(c14);
float4 cloudParams5 : packoffset(c15);
float4 cloudParams6 : packoffset(c16);
float4 skySliceInfo : packoffset(c17);
float4 cloudLightSteps[8] : packoffset(c18);
}



// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
float4 v0 : POSITION0,
float2 v1 : TEXCOORD0,
out float2 o0 : TEXCOORD0,
out float4 o1 : SV_POSITION0)
{
float4 r0;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = skySliceInfo.yw + -skySliceInfo.xz;
o0.xy = v1.xy * r0.xy + skySliceInfo.xz;
o1.xyzw = v0.xyzw;
//float4 params = IniParams.Load(0); This is working but the result seems not quite right
//float4 stereo = StereoParams.Load(0);
//o1.x+=stereo.x*stereo.y;

return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1


Maybe theres a better formula to fix this?

Posted 12/08/2018 01:33 AM   
Maybe just use: [code]o1.x += stereo.x;[/code]
Maybe just use:

o1.x += stereo.x;

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

Like my fixes? you can donate to Paypal: dhr.donation@gmail.com

Posted 12/08/2018 10:12 AM   
Thanks DHR with your formula it looks nearly perfect but there are some strange stripes over the sky and on the left and right side are some smearing effects if i put depth to zero they gone, convergence hasnt any impact on it.
Thanks DHR with your formula it looks nearly perfect
but there are some strange stripes over the sky and
on the left and right side are some smearing effects
if i put depth to zero they gone, convergence hasnt
any impact on it.

Posted 12/08/2018 02:09 PM   
Use this. Is a formula polished by Helifax for Frostibe3 engine with similar issue that may work Maybe you need to change the "0.88" and "1.15" for this game. [code]o1.x += stereo.x * 0.88; o1.xyz *= 1.15;[/code]
Use this.
Is a formula polished by Helifax for Frostibe3 engine with similar issue that may work
Maybe you need to change the "0.88" and "1.15" for this game.

o1.x += stereo.x * 0.88;
o1.xyz *= 1.15;

MY WEB

Helix Mod - Making 3D Better

My 3D Screenshot Gallery

Like my fixes? you can donate to Paypal: dhr.donation@gmail.com

Posted 12/08/2018 03:24 PM   
  84 / 88    
Scroll To Top