Community
3ds Max Forum
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BUG: DirectX Shader using packaged blend_dxsas.fx is broken

9 REPLIES 9
Reply
Message 1 of 10
lightcube
824 Views, 9 Replies

BUG: DirectX Shader using packaged blend_dxsas.fx is broken

DirectX Shader using packaged blend_dxsas.fx is broken. That shader is supposed to show you two textures that are blended based on Vertex Alpha. But that is not working ... it shows no textures.

The problem seems to be that the Shader is no longer compatible--as the Shader Properties window in Slate has this invalid rollout:

blend_dxsas.fx Parameters

No Parameters to edit.

Normally, that should allow you to assign two textures.

1) Create a Plane with 64 x 64 width/length segments
2) Apply a Vertex Paint modifier
3) Set this Vertex Paint to the Alpha channel
4) Paint some alpha
5) Open Slate Material Editor
6) Create a new DirectX Shader material
7) Load this file as the shader: $maxroot\maps\fx\blend_dxsas.fx
😎 Apply this material to the Plane you created above
9) Notice that you cannot add the textures into the shader anymore!

At this point, you should be able to see the two textures based on the painted alpha. You should be able to do more vertex painting and see the results of the two textures in real-time in the viewport. But the only thing you can see is a solid white on the object.

Please report this bug.


Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti
9 REPLIES 9
Message 2 of 10
RaduCosma
in reply to: lightcube

It's not broken, it's a DirectX9 shader and you're using Nitrous Direct3D 11.

Here is a shader I just modified to work in DirectX 11. It has 2 techniques, one with Shader Model 5.0 for DX11 cards, and one with SM 4.0 for DX10.

My initial testing showed good results, but please let me know if you have any trouble.

Cheers!

blend_dxsas11_fixed.zip

Message 3 of 10
lightcube
in reply to: lightcube

Excellent help!

I tested your file. It works great in Shaded viewport mode. But in Realistic, it is solid gray (no texture). I tried with both techniques as well as a dozen different viewport settings. Any ideas on this?

Regarding the packaged one and my ignorance: Even if not broken technically, it's broken in effect if you've been relying on that packaged shader and haven't taken the time to learn to write DX shaders 🙂 After posting I did open the new standard FX file and compared it to the older one and concluded what you pointed out.


Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti
Message 4 of 10
RaduCosma
in reply to: lightcube

Ah, yes. It is a side effect of enabling the Depth Stencil. I'm not sure if it's a max bug or bad shader coding on my part.
Anyway, I'm attaching a version without the Depth Stencil. It should work great in Realistic mode, but you may have render order issues in Shaded mode.

I guess Autodesk didn't have time to make DX11 versions for all the bundled shaders 🙂

blend_dxsas11_nodepth_fixed.zip

Message 5 of 10
lightcube
in reply to: lightcube

Thank you immensely. I've sent you a PM. I'd like to package this with one of my tools and share a credit and link to you.

I modified it so that it has 4 techniques... so the user can switch based on whether they are using Shaded or Realistic.

Fixed syntax for dx10 technique.

blend_dxsas11_nitrous_2.zip



Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti
Message 6 of 10
RaduCosma
in reply to: lightcube

I appreciate it but I don't think there's any need to credit me. After all, this shader is from Autodesk, I just made some modifications. From my point of view feel free to use it however you want. 🙂

Great idea to add extra techniques for "no depth". One thing I have to point out though: there was a typo in the files I uploaded. DX10 techniques have to be initialized as technique10 and only DX11 (SM 5.0) as technique11. So you should edit your file as well.
Message 7 of 10
lightcube
in reply to: RaduCosma

Aha... thank you. Again 🙂 This erases a really low mood I was in when I discovered the incompatibility with the packaged shaders. Perhaps I need to start learning the shader syntax... but honestly I've preferred to avoid it because I personally only use the DX shader for one specific utility.


Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti
Message 8 of 10
RaduCosma
in reply to: RaduCosma

Glad I could help 🙂
Message 9 of 10
lightcube
in reply to: RaduCosma

Thanks again. I updated the attachment above to fix the dx10 technique syntax. So now it has dx10 and dx11 syntax.


Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti
Message 10 of 10
lightcube
in reply to: lightcube

I am curious if you know the way to update the DX file to display realtime shadows in the viewport?



Shawn Olson

Developer of Wall Worm
3ds Max plugins and Scripts

3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019

Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report