question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About Error while using shadertoy.com examples

See original GitHub issue

feature request?

– OR –

bug report?

Hello good afternoon

About Error while using shadertoy.com examples

I tried to use the following GLSL script, but it generated an error, you can do a simulation please

https://www.shadertoy.com/view/Ms2SD1

library version

npm ls gl-react gl-react-dom gl-react-native gl-react-expo # Please run and paste the output of this

├── gl-react@3.15.0 └── gl-react-dom@3.15.0

Expected behavior

Work

Actual behavior

Not Work

Steps to reproduce the behavior

captura de tela de 2018-10-29 18-41-49

https://gist.github.com/mozgbrasil/42b46029db7304b79192321ee1e84735

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
grecommented, Oct 31, 2018

similarly there is no such void main( out vec4 fragColor, in vec2 fragCoord ) { entry point in GLSL.

entry point is void main (void) . it does not take parameters. and fragColor is actually a global variable called gl_FragColor

gl-react however will send a varying vec2 uv; (need to declare it)

that is a value in [0, 1] range

1reaction
brysonandrewcommented, Jan 8, 2019

@mozgbrasil

This is a bit closer to what you are looking for https://codesandbox.io/s/zz2w9llpml

There are many things you must change in your example to make it work.

Here is a summary -

  1. As @gre stated replace void main( out vec4 fragColor, in vec2 fragCoord ) with void main (void)
  2. Set resolution yourself. Resolution won’t change so vec3(1) is enough.
  3. Set the position of the scene
vec2 ouv = -1.0 + 2.0 * uv;
    ouv.x *= resolution.x / resolution.y;

This helped - https://stackoverflow.com/questions/24820004/how-to-implement-a-shadertoy-shader-in-three-js 4. Set the time yourself. I built a loop and passed time as a uniform.

The lighting isn’t quite right in my example, I haven’t figured that one out yet. Let me know if you manage to find a solution for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

failure to return - Shadertoy
Apparently GLSL doesn't require all codepaths to return a value, so you'll get undefined behavior on the left half of this shader.
Read more >
Fakepath - Shadertoy
Created by cyberjax in 2021-04-02. A simple example that produces the following compiler error. Unknown Error: C:\fakepath(95,7-32): error ...
Read more >
This should be allowed! - Shadertoy
Compilation success of Common tab is useless, but its failure prompts Shadertoy to block the shader on startup and prevent saving.
Read more >
3 - Shadertoy
seems like on linux, at runtime full IEEE floats with ... strangely, compilation errors show up only if another compil error (e.g. redef)....
Read more >
SHADER ERROR!
We use cookies to give you the best experience on our website. If you continue using Shadertoy, we'll assume that you are happy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found