Comments (10)
Is it also possible to change the shadow color?
from xbpagecurl.
The current shadow algorithm is a simple one that assumes an opaque page. A
new, more complex algorithm must be implemented in order to generate proper
shadows for transparent views. I have been thinking about it. Ideas are
always welcome.
from xbpagecurl.
Okey, I'm too novice for that, but I can try :P where in the code should i look?
If I fail, is it possible to remove the shadow?
Edit: Got an idea... maybe if the shadow is an image wich gets the same height, angle and position as the curl, not an ideal solution but maybe a quick fix?
from xbpagecurl.
I still didn't implement a method to disable the shadows. What you can do
is to, in the NextPageNoTextureFragmentShader.glsl, change the main
function to this:
void main() { gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); }
Just a quick and dirty workaround..
The problem with transparent views is that the shadow should have the same shape as the alpha of the view. We could use some sort of shadow mapping algorithm.
There's not yet a direct way to change the color of the shadow, but its possible to do so by changing the rgb of the color that is returned in the fragment shader, like gl_FragColor = vec4(0.8123,0.14, 0.59, l).
from xbpagecurl.
Thank you :)
I'll read up on shadow mapping and glsl and see if I can come up with something.
from xbpagecurl.
I made a quick try and got a somewhat satisfactory result
if (d < 2.0_u_cylinderRadius) {
float a = (d/(2.0_u_cylinderRadius))_M_PI;
l = (d + 1.0)_0.5;
}
gl_FragColor = vec4(0.0, 0.0, 0.0, l);
it is not repeated all over the screen, but it is a solid shadow.
from xbpagecurl.
Ah I see, you're drawing a linear instead of a cosine shadow. Yea, it should work.
from xbpagecurl.
Yeah. the problem is to get it faded, I managed to get it faded one direction, now I'm trying to figure out how to flip the shadow 180°
if (d < 2.0_u_cylinderRadius) {
float a = (d_(1.0/u_cylinderRadius))/M_PI;
//l = (cos(a)+1.0)_0.5;
l = (a)_0.5;
}
from xbpagecurl.
Try l = d > 0.0? 1.0 - d/(2.0*u_cylinderRadius): 0.0;
On Tue, Nov 1, 2011 at 11:33 AM, Jerhammar <
[email protected]>wrote:
Yeah. the problem is to get it faded, i managed to get it faded one way
now im trying to figure out how to flip the shadow 180if (d < 2.0_u_cylinderRadius) {
float a = (d_(1.0/u_cylinderRadius))/M_PI;
//l = (cos(a)+1.0)_0.5;
l = (a)_0.5;
}Reply to this email directly or view it on GitHub:
#13 (comment)
from xbpagecurl.
Thanx, worked perfectly!
from xbpagecurl.
Related Issues (20)
- Weird behavior of the example project HOT 3
- tap to uncurl
- Curl -- corner doesn't always pick up HOT 4
- some bug
- XBPageCurl curling acting weird
- another gpus_ReturnNotPermittedKillClient crash HOT 2
- How to implement pages flipping like iBook? HOT 1
- Page Flipping in Two Page Book HOT 1
- Source differences between Git and Cocoapods HOT 1
- duplicate symbol _XBAnimationInterpolatorEaseInOut HOT 3
- updating the frame of the curlView for the next page HOT 2
- Calling drawImageOnNextPage: not working
- Unable to use this library in Swift.
- OpenGL Error 501 in console logs
- EXC_BAD_ACCESS in applicationWillResignActiveNotification
- curl animation don't work very well on IPhone 6 HOT 1
- curl effect render hide and show
- won't compile cleanly. Needed: In XBAnimation.h, the 4 blocks need to be marked extern
- https://github.com/bachelora/iOS-PageCurl-OpenGL
- Unable to integrate this onto the Swift project 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 xbpagecurl.