[Closed] directx fx shader UI manipulation
Hello there,
Just trying since a few more hours to get a UI for the HLSL fx file import the way I’d like it. What I need is to manipulate a vector in the shader of undefined length (but at least 8). When vector size exceedes 4, the value isn’t shown in the GUI anymore and hence isn’t visible to the delegate variable.
Any ideas anyone?
Cheers,
Gunnar
Hi,
You’re talking about FX code or MAXScript code ? Can you post the code please ?
It seems that you’re having a problem with DXSAS annotations between shaders creation tools (FX Composer, RenderMonkey) and 3ds Max. For example, FXComposer uses DXSAS v0.85 and 3ds Max uses a subset of v0.85.
hi Yannik,
thanks for the reply.
I’m talking about the Material Editor Gui that is dynamicaly created on loading a shader with the DirectX material or on extending a DX9 Material with macscript with replaceUI:false.
in my shader code I’ve a matrix defined which I’d like to manipulate with some other UIItem than
Supported UI elements are ColorSwatch (floating point), Spinner and Bitmap button.
The vector looks like this: (but I tried other notations as well)
float2 falloffvertices[] = {
float2(0.0f,0.0f), // direction TO the camera
float2(0.25f,0.15f),
float2(0.45f,1.0f),
float2(0.7f,0.1f),
float2(1.0f,0.0f) // direction pendicluar to the camera
};
anyway, my question would be whether there is any posibility to access this vector without having to manipulate a color that max’s parser automatically ceates out of it. (That approach also leaves out the 4th value of the vector…)
I’m currently looking in the SDK for extending the parser. but I stil can’t believe max’s developers just don’t expect people to have vectors in their shaders…
Any ideas appreciated!
Cheers,
Gunnar
Hi,
Thanks for the explanation.
Do you want to manipulate a matrix or a vector ? It’s a bit confusing.
Matrix can be coded like that (I’ve never tested that but I hope it could work) :
float4x4 Identity <
string UIName = "Identity Matrix";
> = {{1.0f, 0.0f, 0.0f, 0.0f},
{0.0f, 1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 1.0f, 0.0f},
{0.0f, 0.0f, 0.0f, 1.0f}};[font=Verdana]
Also, I’ve written an article about Using DirectX Shaders in 3ds Max published by Gamasutra. This article is about using FX effects in MAXScript and with the SDK.
I think that writting your own parser is a waste of time (too difficult to develop, with many bugs…).
[/font]
Hi.
=) Guess what I have my quote from! I wasn’t aware though, that you wrote it… funny that. Well, I was aiming for manipulating a vector, *preferably of two dimensions, thus, a matrix, but it would be totally alright to get max to comunicate with at least a one dimensional vector of length more than 4.
The notation you suggested didn’t work as it isn’t showing up in the material editor and isn’t visible to the delegate variable. Or am I missing something?
btw. I tried both parsers (ParamID = “0x0” and ParamID = “0x0001”) and
multiple UIItem semantics (UITypes).
My experience is that is doesn’t appear in the delegate as long as max isn’t able to parse it. And maximilian just doesn’t see more that four elements in a vector. poor guy.
Any idea? <=/
Hi,
I will take a look at this problem this evening (I’ve not 3ds Max on the PC I am this afternoon).
I just realized that I had that quote from the techdoc at Sparks. but i used your article frequently in the recent past while trying stuff.
you’re recommending the iGame interface there. I was not having a look at it so far I admit. I will now…
Catcha later then.
cheers