Comments (3)
Is there a way to import only those functions which are actually defined for FShade? (for example, step is not defined, but is in Aardvar.Base.Fun).
Sadly not atm. but this would certainly make sense. maybe a new namespace FShade.Base
re-exporting all the available functions could help there.
How would I go about adding a function? Either one which is built-in, or one which I include from a glsl library. I would like to add the step function, which I assume is not in their because Aardvark has a step function with a different meaning and type signature.
Adding an intrinsic function can be done via the GLSLIntrinsic
attribute like:
[<GLSLIntrnsic("mix({0}, {1}, {2})")>]
let mix (a : float) (b : float) (t : float) : float = onlyInShaderCode "mix"
Hope that helps.
from fshade.
Hey, yes that should be possible, as long as you use array literals (instead of lists) if memory serves.
In that case the Arr
wrapping should be unnecessary, since FShade will turn the array into a constant.
Another option would be to create an Arr
using Unchecked.defaultof<_>
as initial value and then set the elements via mutation.
from fshade.
I would like to contribute to the documentation and with an example, but I have been struggling due to #17 and some obscure runtime exceptions. For example, if I attempt to initialize an Arr
like Arr([1.0, 2.0])
but forget to annotate with a type, I get a runtime exception about INatural being invalid. I am trying to track these as I go.
But I can initialize arrays, and I found IntrinsicFunctions.fs
which helps with #17. I'm not sure I get what's going on though. These seem to be overriding the functions in Aardvark.Base.Fun
. But....
-
Is there a way to import only those functions which are actually defined for FShade? (for example,
step
is not defined, but is in Aardvar.Base.Fun). -
How would I go about adding a function? Either one which is built-in, or one which I include from a glsl library. I would like to add the
step
function, which I assume is not in their because Aardvark has astep
function with a different meaning and type signature.
from fshade.
Related Issues (20)
- Helper function created where both parameters have the same name HOT 5
- Version 4.0.1 produces invalid code HOT 2
- Can I write WebGL with FShade ? an integrate it with Fable.io? HOT 17
- add textureLodOffset / SampleLevel with offset HOT 1
- Documentation of missing functions listed in tests HOT 3
- Cannot pass tessellation levels from TCS to TES
- Compute shader integer image support HOT 12
- Multiple Interpolation Qualifiers
- Toposort issues with RTX shaders HOT 2
- Missing Intrinsic `exp2` HOT 1
- Missing vector swizzles HOT 6
- Missing `step` HOT 3
- Invalid characters in function names HOT 1
- Missing SampleLevelOffset (textureLodOffset) HOT 1
- bad swizzle: 'o' HOT 3
- M44d.TransformPosProj HOT 7
- Link to Aardvark.Rendering is broken HOT 1
- URL leads to "Welcome to nginx!" HOT 2
- Record parameters not properly handled (null smuggled in) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fshade.