Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Distinguished Ambassadors
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Graphics, Gaming, and VR forum
random number with mali 400 mp
Jump...
Cancel
Locked
Locked
Replies
7 replies
Subscribers
136 subscribers
Views
5842 views
Users
0 members are here
Mali-GPU
Mali-400
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
random number with mali 400 mp
Fernando Sanchez
over 11 years ago
Note: This was originally posted on 22nd November 2012 at
http://forums.arm.com
I am having no success into generating random noise with the MALI 400 MP GPU, the code I'm using is next which works with all the other GPU vendors I've tried.
On this specific GPU will return just a few cross screen dotted thin lines with a wide space between them, instead of the expected random noise.
float rand(vec2 co)
{
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
void main()
{
vec3 color = texture2D(u_texture, v_texcoord);
vec3 noise = vec3(
rand(gl_FragCoord.st / 1000.0
)
);
gl_FragColor = vec4(color + noise, 1.0);
}
Is there something to take into account in this specific GPU hardware?
Thanks
Parents
Chris Varnsverry
over 11 years ago
Note: This was originally posted on 4th December 2012 at
http://forums.arm.com
Hi Sanchiski,
This is a tricky problem to solve in FP16 and we're looking into some options. A few notes however:
In your first example you use gl_FragCoord as the parameter to your rand function. In such cases, given a value of gl_FragCoord, the result of rand is determinable, and is invariant across frames. In such cases it is probably wiser to either render to a texture or precompute this on the CPU and upload as a texture, and sample this in your fragment shader, saving yourself cycles each frame.
For the other methods where texture coordinates are used, it might still be worth precomputing this, as you know the range and so a sufficiently high res texture sampled in the correct way will yield the same results. We are looking into some options on how to compute this on the fly, but as the result is invariant on the parameter passed in, this is probably a more correct method.
Thanks,
Chris
Cancel
Up
0
Down
Cancel
Reply
Chris Varnsverry
over 11 years ago
Note: This was originally posted on 4th December 2012 at
http://forums.arm.com
Hi Sanchiski,
This is a tricky problem to solve in FP16 and we're looking into some options. A few notes however:
In your first example you use gl_FragCoord as the parameter to your rand function. In such cases, given a value of gl_FragCoord, the result of rand is determinable, and is invariant across frames. In such cases it is probably wiser to either render to a texture or precompute this on the CPU and upload as a texture, and sample this in your fragment shader, saving yourself cycles each frame.
For the other methods where texture coordinates are used, it might still be worth precomputing this, as you know the range and so a sufficiently high res texture sampled in the correct way will yield the same results. We are looking into some options on how to compute this on the fly, but as the result is invariant on the parameter passed in, this is probably a more correct method.
Thanks,
Chris
Cancel
Up
0
Down
Cancel
Children
No data