Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
Tools and Software
Graphics and Gaming
Jump...
Cancel
Graphics and Gaming
Graphics and Gaming forum
God Ray effect (light scattering) with Mali GPU
Blog
Forum
Videos & Files
Help
Jump...
Cancel
New
State
Accepted Answer
Replies
10 replies
Subscribers
133 subscribers
Views
6184 views
Users
0 members are here
OpenGL ES
Mali-GPU
Related
God Ray effect (light scattering) with Mali GPU
Offline
Thanh Vu
over 7 years ago
Note: This was originally posted on 10th May 2012 at
http://forums.arm.com
Hello everyone,
I'm implementing the God Ray effect for an Android game on Mali-400 based devices (here is Samsung I9100 and Samsung I9300).
I've followed this article
http://fabiensanglard.net/lightScattering/index.php
But the effect is not good (as you can see in the attached file).
It did work on Win32 and other Adreno and PowerVR based devices.
I think that there's problem with the texture's coordinate fetch from vertex shader to fragment shader, the interpolation computation may cause this issue.
I hope that you can give us some idea on this.
Thank you.
Parents
0
Offline
Pete
over 7 years ago
Note: This was originally posted on 14th May 2012 at
http://forums.arm.com
Hi,
great, glad the modification works OK - thank you for trying it.
For the performance issue, let's examine what's feasible on a typical embedded GPU.
Taking the same example device as above:
Mali-400 MP4 @ 266MHz
800x480 WVGA screen @ 30FPS
This means we have a maximum of 4 * 266*1.0e6 = 1.064e9 fragment cycles available per second. That is a theoretical maximum - perhaps 85% efficiency is more realistic, so 9.044e8 cycles. Also the aim is 30FPS - so divide by 30 becomes ~30M cycles.
Those 30M cycles will have to render both the main screen and the "light scattering" FBO. Both contain fairly standard looking geometry, but any overdraw (where a fragment may be shaded more than once) must be taken into account. We could allow a factor of 2x overdraw - this will be the same for either the FBO or the main surface, since they are the same geometry. So now there are perhaps 15M cycles available. If the main scene uses a 3 cycle fragment shader, that's 800*480*3 ~= 1M cycles used. That leaves 14M cycles for an FBO. If the FBO was scaled to 1/4 of the main surface, that gives 14M / (400*240) ~= 145 cycles per fragment. The example shader above takes 2 cycles per sample, so approximately 72 samples might be possible to stay within budget.
Things get harder if it's a larger display, such as 1280x800. In that case, even with a 1/4 area FBO I think the maximum samples would be nearer 23 to still have a chance of hitting 30FPS.
Have you experimented with different size FBOs and reduced number of samples? Does the performance increase? Is the result visually acceptable? Don't forget to enable bilinear filtering (GL_TEXTURE_MAG_FILTER = GL_LINEAR) when sampling the "light scatter" FBO if it's been scaled down!
If the performance or visual quality aren't high enough, it may be that another way of achieving a similar effect must be considered.
HTH, Pete
Cancel
Up
0
Down
Reply
Accept answer
Cancel
Reply
0
Offline
Pete
over 7 years ago
Note: This was originally posted on 14th May 2012 at
http://forums.arm.com
Hi,
great, glad the modification works OK - thank you for trying it.
For the performance issue, let's examine what's feasible on a typical embedded GPU.
Taking the same example device as above:
Mali-400 MP4 @ 266MHz
800x480 WVGA screen @ 30FPS
This means we have a maximum of 4 * 266*1.0e6 = 1.064e9 fragment cycles available per second. That is a theoretical maximum - perhaps 85% efficiency is more realistic, so 9.044e8 cycles. Also the aim is 30FPS - so divide by 30 becomes ~30M cycles.
Those 30M cycles will have to render both the main screen and the "light scattering" FBO. Both contain fairly standard looking geometry, but any overdraw (where a fragment may be shaded more than once) must be taken into account. We could allow a factor of 2x overdraw - this will be the same for either the FBO or the main surface, since they are the same geometry. So now there are perhaps 15M cycles available. If the main scene uses a 3 cycle fragment shader, that's 800*480*3 ~= 1M cycles used. That leaves 14M cycles for an FBO. If the FBO was scaled to 1/4 of the main surface, that gives 14M / (400*240) ~= 145 cycles per fragment. The example shader above takes 2 cycles per sample, so approximately 72 samples might be possible to stay within budget.
Things get harder if it's a larger display, such as 1280x800. In that case, even with a 1/4 area FBO I think the maximum samples would be nearer 23 to still have a chance of hitting 30FPS.
Have you experimented with different size FBOs and reduced number of samples? Does the performance increase? Is the result visually acceptable? Don't forget to enable bilinear filtering (GL_TEXTURE_MAG_FILTER = GL_LINEAR) when sampling the "light scatter" FBO if it's been scaled down!
If the performance or visual quality aren't high enough, it may be that another way of achieving a similar effect must be considered.
HTH, Pete
Cancel
Up
0
Down
Reply
Accept answer
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Not Answered
mali-checker showing as no opengl es version support available.
0
4113
views
0
replies
Started
2 months ago
by
tattimano
Answered
Zero GPU activity during "long" periods of time
+1
Mali GPU (Bifrost Architecture)
Streamline Performance Analyzer
5165
views
5
replies
Latest
2 months ago
by
JPJ
Answered
Help interpreting L/S and Texture memory usage
0
Mali GPU (Bifrost Architecture)
Streamline Performance Analyzer
5582
views
4
replies
Latest
2 months ago
by
JPJ
Not Answered
Display problem in GTK/Webkit with RK3288 Mali-T764
0
4712
views
1
reply
Latest
2 months ago
by
IronKang
Answered
Texture Cache on Mali-G76
+1
4996
views
1
reply
Latest
2 months ago
by
Kévin Petit
<
>
View all questions in Graphics and Gaming forum