Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name: Password:
Ambiera Forum > CopperCube > Programming and Scripting
Array & Shader...
Author Text

sulbcon
Registered User
Quote
2022-07-15 09:15:09

Is it possible to pass strings and arrays to shaders in coppercube?


just_in_case
Moderator
Quote
2022-07-16 07:55:47

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.


sulbcon
Registered User
Quote
2022-07-17 07:58:56

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...


sulbcon
Registered User
Quote
2022-07-17 08:01:21

And like err what is the recommended number of collision lines that could be drawn per frame without causing frame drops...


Arcanjo
Guest
Quote
2022-07-17 13:28:07

Sulbcon, you and Jesus can do all. The powerful God!!!


sulbcon
Registered User
Quote
2022-07-17 16:59:18

Yeah we can...


sulbcon
Registered User
Quote
2022-07-31 00:43:01

Please does anyone know coppercube's glsl and opengl versions


just_in_case
Moderator
Quote
2022-07-31 05:58:17

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.


sulbcon
Registered User
Quote
2022-08-01 00:22:59

Err... What I meant was is coppercube's opengl 1.1, 2.1 or 4.0


just_in_case
Moderator
Quote
2022-08-01 11:48:59

I am not sure but I think it uses openGL 2.1


sulbcon
Registered User
Quote
2022-08-02 03:59:11

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...


just_in_case
Moderator
Quote
2022-08-02 08:20:08

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.


sulbcon
Registered User
Quote
2022-08-02 22:27:38

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).


sulbcon
Registered User
Quote
2022-08-02 22:30:03

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.


just_in_case
Moderator
Quote
2022-08-03 06:12:22

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.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© 2020 Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact