Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7838367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:05:12+00:00 2026-06-02T15:05:12+00:00

I am beginning an Spherical Harmonics shader project for an iOS app I am

  • 0

I am beginning an Spherical Harmonics shader project for an iOS app I am writing. I have begun by reading this excellent in-depth paper on the subject (PDF) – http://bit.ly/aQmax3.

The paper describes a scene pre-processing step that involves ray-casting. Can someone describe how ray-casting can be performed using GLSL on iOS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T15:05:14+00:00Added an answer on June 2, 2026 at 3:05 pm

    If you’re referring to the ray casting used in that process in determining which surfaces are hit by ambient light (for the ambient occlusion shading), I’ve done that within my Molecules iOS application. I talk a little about the process in this blog post and this paper I submitted for the Nanotech conference, but I can expand upon that.

    In my case, I use depth testing to determine the areas on a surface hit by ambient light at various orientations. I take my model and render it at a series of orientations that correspond to someone looking at it from an evenly distributed set of points on a sphere surrounding the object. For each point on the object’s surface, I determine whether or not that point is visible from that orientation by testing its transformed Z position against the depth calculated for the visible surface at that point.

    I track this visibility over the many orientations of the object through the use of an ambient occlusion intensity texture. I use a custom shader to map between locations on this texture and positions on the surface of my object. If the position is visible in that rotation, I write out a grey value (with a value of 1 / (number of orientations)), and if hidden I write out black. I then use an additive blend mode to accumulate these values in order to determine which surfaces were hit the most times by ambient light.

    My ambient occlusion textures look something like the following:

    Ambient occlusion texture

    In this case, I was mapping a series of spheres as part of a molecular model, so each rectangle in that texture is the surface area of a sphere, flattened using a mapping function. When wrapped around the actual model, these values look like this:

    Mapped ambient occlusion values

    Also, for determining the depth values of my object at various orientations, I had to create my own depth writing function that calculates per-pixel depth values and stores those into a custom depth texture. I then read from this texture when determining whether ambient light hits a point in an orientation or not. If I remember correctly, you can’t read from the depth buffer directly on iOS devices, so you may need to do something similar for your model, as well.

    This doesn’t cover the reflected diffuse lighting case, but it at least describes the means by which I did my ambient occlusion shading. The source code for this application is available at the above link, if you wish to dig into it and see how all this works in practice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At the beginning of the bootstrap.js code file they have this !function($) { what
Since beginning to use VB.NET some years ago I have become slowly familiar with
I'm a beginning web developer sitting on an ambitious web application project. So after
I am beginning to work on my first OpenGL iPhone app, but I've hit
I am in early beginning of learning and deploying Win App using C#, Now
I am just beginning to get into desktop application development, and have chosen C#
Just beginning my journey in ASP.Net MVC and I have a query about something
at the beginning I have: #include <sstream> #include <iostream> #include <stdio.h> #include <iomanip> #include
I am just beginning to work on android and seems like I have got
I'm beginning a project that will require me to export a user generated 3D

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.