Comments (3)
Which shader are you using? The library itself doesn't offer any and the GLTransitionsShaderTransition
class doesn't add any constants to the shaders it is provided with:
from libgdx-screenmanager.
You are right.
The problem was in the following shader:
private String circleCropText =
"uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)\n" +
"\n" +
"vec2 ratio2 = vec2(1.0, 1.0 / ratio);\n" +
"float s = pow(2.0 * abs(progress - 0.5), 3.0);\n" +
"\n" +
"vec4 transition(vec2 p) {\n" +
" float dist = length((vec2(p) - 0.5) * ratio2);\n" +
" return mix(\n" +
" progress < 0.5 ? getFromColor(p) : getToColor(p), bgcolor, step(s, dist)\n" +
" );\n" +
"}\n";
I think I found it in one of your examples?
Changing it to this:
"uniform vec4 bgcolor; // = vec4(0.0, 0.0, 0.0, 1.0)\n" +
"vec4 transition(vec2 p) {\n" +
" vec2 ratio2 = vec2(1.0, 1.0 / ratio);\n" +
" float s = pow(2.0 * abs(progress - 0.5), 3.0);\n" +
" float dist = length((vec2(p) - 0.5) * ratio2);\n" +
" return mix(\n" +
" progress < 0.5 ? getFromColor(p) : getToColor(p), bgcolor, step(s, dist)\n" +
" );\n" +
"}\n";
...fixed the problem.
The shader compiler is opinionated about constants. Variables defined outside the main method are considered constants I think... So in this case ratio2 and s would be constants in the first example.
from libgdx-screenmanager.
I think global variable initializers must be constant expressions
means that ratio2
and s
can't use uniforms and must be constant values instead. Anyways, I mentioned on the wiki that there can be platform-specific limitations to compiling shaders.
from libgdx-screenmanager.
Related Issues (20)
- Inverted Y values
- Screenmanager.push() isnt working HOT 3
- Slicing Transitions with high slice counts are not working HOT 2
- Feature request: An event in ManagedScreen that is called each time a transition ends, on both involved screens HOT 3
- GWT build issue HOT 2
- Remove the libgdx-screenmanager-gwt extension
- crash when minimizing HOT 6
- unable to get dependancies for 0.6.8 HOT 6
- Adapter classes? HOT 2
- Help GLTransitionsShaderTransition HOT 3
- Can I add screen to screenmanager when it is required? HOT 3
- Can I use show() in ManagedScreen class or use create() only HOT 3
- resize() should be after show() in life cycle. HOT 1
- Cannot access ManagedGame HOT 1
- The currently bound framebuffer (0) doesn't match this one HOT 5
- crash on ios HOT 3
- e: Supertypes of the following classes cannot be resolved.
- Inconsistencies between libgdxs implementation of setScreens() and screenmanager. HOT 3
- Little ideas 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 libgdx-screenmanager.