Code Monkey home page Code Monkey logo

Comments (6)

OxyFlax avatar OxyFlax commented on June 12, 2024 4

Hi @markdaws
I did the swift versions of part1, part2, part3 and part4 branches.
Can you create the new branch part1_swift based on the "Initial commit" to allow me to make a pull request? Then based on the part1_swift make a part2_swift etc... so that people would be able to follow the different commits ;)

My repo is here if you want to see https://github.com/OxyFlax/arkit-by-example

from arkit-by-example.

timothyrchew avatar timothyrchew commented on June 12, 2024 2

@markdaws Thanks for putting this together. Would love to see a Swift version.

from arkit-by-example.

enzyme69 avatar enzyme69 commented on June 12, 2024

Thanks for Swift example and also Mark for nice articles! Studying now~

from arkit-by-example.

enzyme69 avatar enzyme69 commented on June 12, 2024

@OxyFlax I tried recreating your setup (Swift) from scratch, actually more like copy pasting code by code trying to understand the setup. Since you make it so tidy, I get 70% of the setup. Even the setting is very neatly coded.

One thing: Somewhat I am not able to get the "estimate" to affect lighting.

Questions:

  1. Do we need some kind of existing lighting in the scene for estimate to work?
  2. If we are not using PBR, will this estimate works? Is it a matter of passing the value into light?
  3. I am pretty new with PBR, I think I manage to get it working, but not quite sure if the Spherical or the IBL has any effect on the AR Objects. Wonder if we can have object being lit with just PBR, just like in Blender, when using environment light. Currently I am just getting black.

It might, but then again back to first question: I do not seem to get any light to happen, without turning on Default Light.

With Swift version, I am not seeing any light in the scene, but somewhat your cube is reacting to estimate light.

from arkit-by-example.

enzyme69 avatar enzyme69 commented on June 12, 2024

Ok, too many almost whole day, but I think the reason I am getting black is that because this thing needs to be at the very bottom! 💯

Also, intensity and image path is crucial. No error give even if we provide wrong path.

// MARK: - ARSCNViewDelegate


func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {
    guard let estimate = self.sceneView.session.currentFrame?.lightEstimate else {
        return
    }
    
    // A value of 1000 is considered neutral, lighting environment intensity normalizes
    // 1.0 to neutral so we need to scale the ambientIntensity value
    let intensity = estimate.ambientIntensity / 1000.0
    self.sceneView.scene.lightingEnvironment.intensity = intensity
}

from arkit-by-example.

canbal avatar canbal commented on June 12, 2024

@markdaws I didn't realize someone else already put together a Swift version and I ended up doing it as well. Here's my version: https://github.com/canbal/arkit-by-example. If interested I'm happy to create a pull request for a swift branch.

Regardless, thanks for the tutorial, it's been very helpful!

from arkit-by-example.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.