Skip to content

Instantly share code, notes, and snippets.

@brandosha
brandosha / bootstrap-dark.css
Last active August 3, 2020 14:05
Dark mode support for some bootstrap components
/* https://gist.github.com/brandosha/b2848a060a691c98eeee54446202c8f3 */
body { transition: background 0.25s; }
@media (prefers-color-scheme: dark) {
body, .full-page-container {
background: black;
color: #cccccc;
}
@brandosha
brandosha / loader.css
Last active August 30, 2019 18:30
Pure CSS Customizable Loading Animation
.loader-container {
width: 100%;
height: 35px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.loader-container > div {
@brandosha
brandosha / README.md
Last active May 29, 2024 05:21
Real time reflections in SceneKit using Metal

Using the ReflectionSession Class for Real Time Reflections in SceneKit

First, create a new ReflectionSession implementation with your SCNView object. Note: You only need one ReflectionSession object at a time.

let reflectionSession = ReflectionSession(inView: scnView)


Then, add the nodes that you want to be reflective to the ReflectionSession using the addNode(_:roughness:) method. Because .physicallyBased materials won't work, the roughness value will determine how much to blur the cubemap images, simulating a roughness effect.

reflectionSession.addNode(node1)
reflectionSession.addNode(node2, roughness: 0.2)