Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Is it possible to pass strings and arrays to shaders in coppercube? |
||||
|
I am not sure, but I think if we can pass them to the shaders, then we have to pass them in floats array. I know it sounds a bit odd, but I think that's what we can do. I am not totally sure about this though. |
||||
|
I'll make an attempt because If it is possible I have an idea that could give me a shader with realtime shadows for point light. Well if it doesn't work I'll use vertex colors instead... But do vertex colors work over programmed shaders... |
||||
|
And like err what is the recommended number of collision lines that could be drawn per frame without causing frame drops... |
||||
|
Sulbcon, you and Jesus can do all. The powerful God!!! |
||||
|
Yeah we can... |
||||
|
Please does anyone know coppercube's glsl and opengl versions |
||||
|
There are examples in the documentation, and some of my shaders do have GLSL webGL supports too, they too have GLSL code. Animate texture coords shader supports webGL, if you want you can check that out. There is also some opengl shaders lying in the forums, I remember an X-ray shader and a toon shader posted by @pmax. https://www.ambiera.com/forum.ph... [/url]https://www.ambiera.com/forum.php?t=3634[/url] [URL]https://neophyte.cf/assets.htmlShaders[/url] hope these links help. |
||||
|
Err... What I meant was is coppercube's opengl 1.1, 2.1 or 4.0 |
||||
|
I am not sure but I think it uses openGL 2.1 |
||||
|
Although this is a deviation from the original topic, I would like to ask; How many collision lines can be drawn per frame before coppercube starts lagging... Could it be a thousand or more than or less than... |
||||
|
To be honest, for me the game lags with just one single line, but I was using in a different manner, I was checking the line collision point and then was checking that collision point collides with a bounding box of a scenenode, but in that approach the single ray was lagging the game, maybe you are going to use it for raycasting, I don't have any benchmark for that though, you can try casting the rays and can test it and maybe share the result with us along with the benchmarks, I tried doing a simple sampling of the texture to create a blur shader with a for loop in HLSL with just 10 samples and it started lagging badly, So even though you cast the rays and created shadows, it might be going to be aa bit expensive when you smooth out the shadows. I am not so sure about openGL though, my test was with HLSL only. |
||||
|
I was thinking about a 50x25 rays per point light actually but seeing that ypur game started lagging with one "collisionpointwithworld" function... This is getting problematic... Maybe I should start plotting a different method for raycasting, maybe calculate it myself. Your reply makes me think that you know where I am heading to (i.e Realtime shadows). |
||||
|
Well all thanks to your shader works, for making me even want to delve into shaders... and it was a pleasant experience. Thanks for the boost. |
||||
|
Coppercube uses, projections in a RTT in the third texture slot of the materials as a shadow, so you can try using the same to create realtime shadows, by rendering the orthogonal projection on a RTT texture and then combining it with the current screen space, but that will again require you to have the C++ source code, as of now CC doesn't provide screenspace shaders out of the box in the editors and current API. You can however do that with the C++ source code. I think if @niko, will just provide a parameter to blur the shadows then they will look much better and smooth, now they are very sharp which makes them look bad, even when you use high details for the shadows. |
|