All pastes #2080688 Raw Edit

Something

public text v1 · immutable
#2080688 ·published 2011-09-10 19:47 UTC
rendered paste body
Hi,

SL# doesn't currently support anything related to geometry shaders.
This is still on our to-do, though, and definitely something we want
to support ASAP.

Please also note that you *have* to use SL# with a binding (or, at
least, write your own binding). SL# is completely engine-agnostic, so
it needs bindings to tell it how to communicate with whatever shader
interface you're working with. We've provided a few (OpenTK, Axiom,
MOGRE, XNA), but if you have another engine you'd like us to support,
just open a GitHub issue about it. (In reality, you could probably
make SL# shaders work without writing a 'real' binding, but this is
strongly discouraged, as we don't guarantee that
GetUniformName/GetAttributeName will always be exposed.)

> Can you tell me the method to call to get global in/out variable last
> values?

You simply access the properties. See
https://github.com/IgniteInteractiveStudio/SLSharp/blob/master/IIS.SLSharp.Examples.Simple/Shaders/MyShader.cs
for an example. Once you've instantiated your shader, you literally
just access your in/out properties to get/set their values.

If you want to get a binding-specific handle to the attribute, just do
something like Shader.GetAttributeLocation(shaderInstance, () =>
shaderInstance.TheProperty).

> https://github.com/IgniteInteractiveStudio/SLSharp/blob/master/IIS.SLSharp/Shaders/ShaderDefinition.Interpolation.cs
> currently this seems to be not working interface, can you make it work or do
> you have another interface?

How is it not working? Note that our intrinsic function interfaces
were designed for GLSL originally, and we're using internal
translation rules to translate them to HLSL. This means that we may
very well be missing a rule for these particular intrinsics. If this
is the case, please open an issue on GitHub and we'll get around to
fixing it.

> are the binary ops and flow conditional ops working?

Yes. Note that the shaders that we pass off to the GPU might have
slightly different control flow, however. When C# is compiled to IL, a
lot of valuable control flow information is lost, so there's only so
much we can do to reconstruct the original code. So, while the
generated code may look different, it's semantically equivalent.

Lastly, please note that the SL# master branch is still in active
development, so the API is not stable yet, plus it is already
completely incompatible with SL# 1.x. This generally isn't a problem,
as the most we're doing right now is refactoring, so if some of your
code breaks, all you have to do is fix a few method/property names.

Regards,
Alex

On Fri, Sep 9, 2011 at 9:38 AM, Mart Martin Martin <mart193@hotmail.com> wrote:
>
>
> Hi mate,
> I strunned into your library when googling, and i have couple of whishes and
> so ill ask a question too.
> Id like to get one example sl# shader based off the Tests/ and is it
> possible to track interpolated variables?
> Can you tell me the method to call to get global in/out variable last
> values?
> https://github.com/IgniteInteractiveStudio/SLSharp/blob/master/IIS.SLSharp/Shaders/ShaderDefinition.Interpolation.cs
> currently this seems to be not working interface, can you make it work or do
> you have another interface?
> are the binary ops and flow conditional ops working?
>
> regards,
> mart