Skip to main content
Tweeted twitter.com/#!/StackGameDev/status/439617038445969408
added 44 characters in body
Source Link
Croll
  • 185
  • 3
  • 10

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers.

But, in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - constructed directly from bytecode blobs (i just don't use techniques/passes, i compile shaders separately).

With Effect class, i can assign new value to any constant in HLSL program by its name, as DirectX allows that, in any time. Example (i haven't tested this; yes, its ugly here):

SharpDX.Direct3D11.Effect fx = //
fx.GetVariableByName("someOption").AsVector().Set<Vector3>(Vector3.OnenewVectorValue);//nice

But i don't use Effect class. How can i set global HLSL variable using Vertex/PixelShader class instance? If it is not possible, shame on SharpDX dev then, in native DirectX it is much easier.

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers.

But, in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - constructed directly from bytecode blobs (i just don't use techniques/passes, i compile shaders separately).

With Effect class, i can assign new value to any constant in HLSL program by its name, as DirectX allows that, in any time. Example:

SharpDX.Direct3D11.Effect fx = //
fx.GetVariableByName("someOption").AsVector().Set<Vector3>(Vector3.One);//nice

But i don't use Effect class. How can i set global HLSL variable using Vertex/PixelShader class instance? If it is not possible, shame on SharpDX dev then, in native DirectX it is much easier.

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers.

But, in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - constructed directly from bytecode blobs (i just don't use techniques/passes, i compile shaders separately).

With Effect class, i can assign new value to any constant in HLSL program by its name, as DirectX allows that, in any time. Example (i haven't tested this; yes, its ugly here):

SharpDX.Direct3D11.Effect fx = //
fx.GetVariableByName("someOption").AsVector().Set<Vector3>(newVectorValue);//nice

But i don't use Effect class. How can i set global HLSL variable using Vertex/PixelShader class instance? If it is not possible, shame on SharpDX dev then, in native DirectX it is much easier.

added 19 characters in body
Source Link
Croll
  • 185
  • 3
  • 10

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. 

But, in my code SharpDX's EffectEffect class is not used: i use PixelShader and VertexShader classes instead - compiledconstructed directly from bytecode blobs (i just don't use techniques/passes, i compile shaders separately).

With Effect class, i can assign new value to any constant in HLSL program by its name, as DirectX allows that, in any time. Example:

SharpDX.Direct3D11.Effect fx = //
fx.GetVariableByName("someOption").AsVector().Set<Vector3>(Vector3.One);//nice

But i don't use Effect class. How can i set global HLSL variable using Vertex/PixelShader class instance? If it is not possible, shame on SharpDX dev then, in native DirectX it is much easier.

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. But in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - compiled directly from bytecode blobs. How can i set global HLSL variable using Vertex/PixelShader class instance?

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. 

But, in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - constructed directly from bytecode blobs (i just don't use techniques/passes, i compile shaders separately).

With Effect class, i can assign new value to any constant in HLSL program by its name, as DirectX allows that, in any time. Example:

SharpDX.Direct3D11.Effect fx = //
fx.GetVariableByName("someOption").AsVector().Set<Vector3>(Vector3.One);//nice

But i don't use Effect class. How can i set global HLSL variable using Vertex/PixelShader class instance? If it is not possible, shame on SharpDX dev then, in native DirectX it is much easier.

added 19 characters in body
Source Link
Croll
  • 185
  • 3
  • 10

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. But in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - compiled directly from bytecode blobs. How can i set global HLSL variable using Vertex/PixelShader class instance?

I am working with SharpDX, i thinking to try using (uniform) global variables instead of constant buffers. But in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - compiled directly from bytecode blobs. How can i set global HLSL variable using Vertex/PixelShader class instance?

I am working with SharpDX, i thinking to try using (uniform) global variables for HLSL constants instead of constant buffers. But in my code SharpDX's Effect class is not used: i use PixelShader and VertexShader classes instead - compiled directly from bytecode blobs. How can i set global HLSL variable using Vertex/PixelShader class instance?

Source Link
Croll
  • 185
  • 3
  • 10
Loading