Post

Replies

Boosts

Views

Activity

Reply to Full transparency while fully reflective (Scenekit material)
I agree in that glass is never 100% transparent. The problem I found with reflection is If I set the transparency to 0.2 the overall end result alpha channel will be multiplied by that value.This will seems to multiply with 0.2 even those fragments with a very strong specular/highlight reflection.(1) Reality: (a) Strong reflection in glass makes objects behind the glass invisible(b) Normal glass without any reflections, adds a little bit of it's tint, depending on thickness, to the color that is visible behind.Compare an image of a pair of glasses with plexi glass side-protectors from my desk: https://imgur.com/cA5ylB0Where there is a reflection the glas becomes basically opaque.(2) SceneKit:(a) High Opacity: Reflections are beautifully reflecting lights etc, unfortunately one can barely see the object behind the glass.(b) Low Opacity: Great visibility of objects behind the glass, but now all the reflections are very subdued.So, what I ended up doing with this is adjusting the alpha-channel of a fragment by the amount of specular lighing that fragment gets:vec3 light = _lightingContribution.specular; float alpha = reflectivity * min(1.0, 0.33 * light.r + 0.33 * light.g + 0.33 * light.b); _output.color.rgb *= min(1.0, (1.5 + 2 * \(minAlpha)) * alpha); _output.color.a = (0.75 + 0.25 * \(minAlpha)) * alpha;`(We put that shader modifier into our release of https://apps.apple.com/app/id1463380262 in case you want to try yourself)@gchiste I also implemented your tip using `blendMode = .add`, which is a good alternative to the above custom shader in same cases.I agree though that it doesn't work perfectly under varying lighting conditions.
Mar ’20
Reply to Binary Swift Package Chicken and Egg Situation
Mhm, so I thought according to the Swift package Manager Team an Xcode project is not necessary to build an xcframework based on a Swift Package. - https://github.com/apple/swift-package-manager/pull/2981#issuecomment-710282803. boris is also referencing the same demo example he did in the WWDC video Distribute binary frameworks as Swift packages - https://developer.apple.com/videos/play/wwdc2020/10147/ from 2020, so I thought this is the latest status compared to the video Binary Frameworks in Swift from 2019. As a swift package, my project automatically gets an extension that provides the Bundle.module extension, e.g. swift let string = NSLocalizedString(self, tableName: nil, bundle: .module, value: "", comment: "") which is no longer available if I wrap the code into an xcodeproj. I thought based on the above mentioned github issue, the xcodeproj way is no longer necessary.
Feb ’21
Reply to Anchoring a Prim to the face doesn't work
So it seems just putting the line token preliminary:anchoring:type = "face" in was not enough. What worked was writing a python script, importing the from pxr import Usd, Sdf, UsdGeom, Kind stuff and then creating a scene hierarchy with /Root/Scenes/Scene/Children/MyModel where the scene gets the anchor-token. The USD Classes reference (https://graphics.pixar.com/usd/docs/api/class_usd_stage.html) helped a little but It was way more complicated then I expected it to be.
Jun ’21
Reply to Glass material in USDZ
I think it would help to specify more clearly what shader system you are using? When it comes to ARKit, ARKit is only the framework that matches your camera to the 3D scene, i.e. handling of the odometry etc. The materials are rendered in the 3D shaders used, technically you can use ARKit with shaders from RealityKit, SceneKit and MetalKit. here's a nice writeup on their differences on stackoverflow
Dec ’22