Skip to contentSkip to conversation

New: sin and cos is broken

Bug 51421 [email protected] 1 participant 2 messages Jun 25, 2012 – Nov 27, 2012

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=51421

Bug #: 51421
Summary: sin and cos is broken
Classification: Unclassified
Product: Mesa
Version: git
Platform: Other
OS/Version: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/i915g
AssignedTo: [email protected]
ReportedBy: [email protected]

sin is broken with negative values
it just renders on the right side of the screen in shaders like
http://glsl.heroku.com/e#2465.1

cos seems to be broken, too, just replace sin with cos on that web page.

mesa: git-d105654
OS: Debian unstable, kernel 3.4

Signature · 3 lines
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#1 lore raw

[Bug 51421] sin and cos is broken

https://bugs.freedesktop.org/show_bug.cgi?id=51421

Golubev Yaroslav <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #1 from Golubev Yaroslav <[email protected]> ---
http://glsl.heroku.com/e#2465.1

Quoted 7 lines

#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;

Quoted 5 lines
void main( void ) {
	float bla = gl_FragCoord.x/resolution.x; 
	float value = sin((bla-0.5)*100.0);
	gl_FragColor = vec4(value,value,value, 1.0 );
}

1) according to specification sin accepts angle in radians:
2) also gl_FragColor.# should be in [0;1], but sin (x in (0;-pi))<0

=> float value = abs(sin(radians((bla-0.5)*100.0))); works fine

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel