-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFE (Request for Enhancement) Vertex shaders for Spheres #87
Comments
This is higher priority: Thanks! |
Perhaps I just need to learn how to compile shaders. I'm not sure how to read the first error message of https://coderextreme.net/X3DJSONLD/src/main/personal/cgeball.x3d I don't know if Spheres can't have vertex shaders, or the shader can't compile. The current version I have removed the issue with the version not coming first, but there's additional variable issues (related to version 140). Some idea of what version might work would be welcome. Essentially, I get errors when I put a version, and different ones when I don't |
I finally found this, looking at it: |
If you're wondering what's wrong with what's displayed, I'm pretty sure the ball is supposed to be translucent and reflective, not magenta. |
We already support shaders on any X3D geometry, including on You can use Or you can use Demos of all above are available in e.g. https://github.com/castle-engine/demo-models ,
That said, it doesn't mean we support any GLSL code in our shader. We cannot. Each browser requires a bit different set of uniforms, due to the way its internal shaders are made (e.g. whether you do animation on GPU or not), and the OpenGL(ES) version used is also relevant (dictates what you can support). In effect, it is hard to write GLSL code for Opening the referenced model ( https://coderextreme.net/X3DJSONLD/src/main/personal/cgeball.x3d ) -- it uses |
I did replace gl_Xxx with castle_Xxx, but I will attempt again.
Sigh,
John
…On Sat, Jan 6, 2024 at 5:05 PM Michalis Kamburelis ***@***.***> wrote:
We already support shaders on any X3D geometry, including on Sphere.
You can use ComposedShader and ShaderPart nodes, from the standard,
https://castle-engine.io/x3d_implementation_shaders.php .
Or you can use Effect, EffectPart nodes, which are CGE-specific extensions
(actually, FreeWRL also implements them but we didn't test for perfect
compatibielity) and allow to write shader code to enhance the "core"
rendering provided the engine.
Demos of all above are available in e.g.
https://github.com/castle-engine/demo-models ,
- https://github.com/castle-engine/demo-models/tree/master/shaders
-
https://github.com/castle-engine/demo-models/tree/master/compositing_shaders
That said, it doesn't mean we support any GLSL code in our shader. We
cannot. Each browser requires a bit different set of uniforms, due to the
way its internal shaders are made (e.g. whether you do animation on GPU or
not), and the OpenGL(ES) version used is also relevant (dictates what you
can support).
Opening the referenced model (
https://coderextreme.net/X3DJSONLD/src/main/personal/cgeball.x3d ) -- it
uses gl_Xxx uniforms which have been removed in new OpenGL.
—
Reply to this email directly, view it on GitHub
<#87 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFMJ54TYAWKCGWKUE5KVPLYNHKFLAVCNFSM6AAAAABBPMMC22VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZHA3DSNRZHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I had to add: uniform mat4 castle_ModelViewMatrix; to my castle.vs shader. So it works, but there are additional warnings, unrelated to this issue. |
Vertex shaders for spheres are pretty critical for my projects, unless PBR can do this:
https://coderextreme.net/X3DJSONLD/src/main/personal/cgeball.x3d
I'm trying to learn how to compile shaders, etc. I'm not sure if that's necessary.
The text was updated successfully, but these errors were encountered: