Lighting | Control LIFX lights from your Mac | Notification library
kandi X-RAY | Lighting Summary
kandi X-RAY | Lighting Summary
A macOS widget for controlling LIFX lights via the LIFX HTTP API. Built on top of LIFXHTTPKit.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Lighting
Lighting Key Features
Lighting Examples and Code Snippets
Community Discussions
Trending Discussions on Lighting
QUESTION
I'm trying to make a raspberry pi control an addressable LED strip using a webserver. Because I can't port forward, the webserver is hosted on python anywhere and the pi is constantly sending get requests to see if it needs to change the lighting.
Certain lighting effects will have their own timings and will need to loop on their own, like a rainbow effect for instance which will loop and update the LED colours at 10Hz. How can I have a script updating the LED colours while it also has to send the get requests? The get requests are relatively slow, so putting them in the same loop doesn't seem like a viable option.
Edit: Thanks for the responses. Turns out I was looking for asynchronous programming.
...ANSWER
Answered 2022-Mar-23 at 02:47You can do this pretty simply with asyncio. Do note that for doing web requests you should also use an async library like aiohttp. Otherwise the blocking http call will delay the other task from running.
Here's an example where you use a context object to allow sharing data between the different tasks. Both tasks will need to have some await
calls in them which is what allows asyncio to switch between the running tasks to achieve concurrency.
QUESTION
I tried to export GLTF model from Blender to Three.js. It works. But I have some artifacts on Three.js with lighting and painting. I have lines and squares in Three.js and I don't know why.
I used only Principled BSDF node in Blender to painting my model. If I set material in Three.js (MeshPhongMaterial) it works fine. But not with Principled BSDF node from Blender. Any ideas?
I'm trying to make the object cast a shadow and react to the lighting. This works well with MeshPhongMaterial and with Principled BSDF. But in the second option, I don't like these black stripes.
...ANSWER
Answered 2022-Mar-14 at 12:12The usual approach to mitigate self-shadowing artifacts is to modulate the bias
property of your shadow-casting light. Try it with:
QUESTION
With three.js, I render earth with textures. I also add an emissive texture to add the city light. But I have an issue, even the light areas of earth emit the cities light.
Exemple:
It is possible to render the emissive texture lighting only in dark areas? I don't find any ways.
My texture is set like this:
...ANSWER
Answered 2022-Feb-17 at 18:57I've been thinking about this problem after my initial comment. I think there's a solution. You could render your city lights in a separate layer after you've rendered the Earth globe. Layers let you do separate render passes with compartmentalized lights that don't affect each other.
With this in mind, instead of making the cities emissive, make them reflect a second light shining from the opposite side of the sun.
Layer 1 renders:
- Sunlight
- Sphere with Earth texture
Layer2 renders:
- Light on the opposite side of the sun
- Another sphere with cities texture
Your city material would look something like this:
QUESTION
Just to give some context, there is an iOS app I'm building (in Xamarin) that requires the ability to fetch files (in an automatic way without having the user to navigate to the files and select them manually) that are stored on External Storage Devices (USB Sticks), and are connected (paired) to an iPhone/iPad.
Users connect a lighting cable to the iOS Devices, and plug their USB Sticks into this lighting cable. Here is an example of the cable that end users use to pair the USB Sticks with their iPhone/iPad, and the app then auto fetches these files from the USB Storage Devices.
The app then performs 2 functions:
- It listens to notifications, for when a usb stick is paired with the iOS Device.
- When it receives this notification, it then proceeds with querying the files on the USB Stick, and reads and processes the files. The app reads these files automatically and the user does not need to manually select these files
I've tried using External Accessory Framework, however that's only suitable for devices that you register with the MFi program. https://developer.apple.com/documentation/externalaccessory
Notifications Center never seems to work (the Notifications that handle when a Device gets Connected and Disconnected, the delegates never get called), and I've tried using the Microsoft Helpers.
I've also tried some 3rd party libraries, but haven't found anything useful.
It doesn't look Apple has any Api Available to auto query and read the files, without having to use a DocumentPickerController. I know this is because of the App Sandbox, and I cannot directly access the Removable Storage Devices.
Now for my questions:
- Are there any 3rd party libraries anybody can recommend, that can help achieve most of the heavy lifting for this task? I'd prefer a library that's compatible with Xamarin, however if it's a native library (Swift or Objective-C Library, Cocoapods) I'm sure there is a binding I can use on nuget.
- Does anybody have any snippets, or documentation, or can point me in the right direction here (Please feel free to post Swift, or Objective-c solutions here if you like)? Where should I look, which Apple Framework (iOS SDK) is most suitable to deal with this situation. And to summarise, is what I'm asking for at all possible on iOS, without having to jailbreak, or get around the App Sandbox?
Update
So I've tried the solution that @Saamer suggested: Detect if USB is connected to iPhone device
Here is an example I wrote just to verify if the callback gets invoked, and the app can detect if a usb is plugged in.
...ANSWER
Answered 2022-Jan-30 at 17:40- I thought you needed to jailbreak but it seems unlikely, a solution is possible for
- CFNotificationCenter's AddObserver seems to be usable for detecting when a device is connected using host attached and detached as shown here
- Or if you don’t submit it to the App Store, you can use this
According to the Apple Docs
You can use the Files app and other supported apps to access files stored on external devices, such as USB drives and SD cards, connected to your iPhone.
- Essentially you have to make your a "supported app". I have downloaded a free app called "Clockology" that I recommend downloading and playing with, which allows users to see data within the app as you can see below:
You generally use UIDocumentPickerViewController
along with the right uttype to get the files from the Files apps or iCloud Drive, and you require activating the Key-value storage
and iCloud Documents
from iCloud
entitlements capability. There's a lot of tutorials on UIDocumentPickerViewController
usage, but you specifically want the capabilities that became available from iOS 13 onwards
This video from WWDC is the best example of getting to where you want. I also didn't find any 3rd party libraries that can help with this
——————-
Edit: If the app does not need to be distributed through TestFlight or the App Store, you can use IOKit and distribute through AppCenter, as long as you have the UDIDs of all the devices you need the app installed on (up to 100?)
QUESTION
Lately when using Jupyter Notebook in VS Code to write some assignments for my studies I ran into a quite annoying problem - whenever there is a mistake in my code cell that prevents it from running, the "traceback" (or however you call it) to the place where the error persists is colored with a high-contrast marker (the color depends on the theme used) and makes the content pretty much invisible unless you manually "select" it with the mouse coursor. Is there any way I could fix it without going too much in-depth into VSCode/Jupyter Notebook extension settings?
The highlighting looks like shown below.
I tried all the themes preinstalled with VS Code such as Monokai, Solarized Light etc., and also a custom theme of my choice called Dracula.
Thanks in advance.
...ANSWER
Answered 2022-Feb-02 at 02:25I also have this problem. It looks like they fixed it less than 1 month ago as of writing this, so it may go away if you update to a recent pre-release of Jupyter in VS Code. Personally, I am going to live with it until the next stable release.
My version of Jupyter in VS Code: Screenshot of Jupyter Versions
Screenshot of vscode-jupyter github: Screenshot of vscode-jupyter github
QUESTION
I'm currently making a 2D game in Javascript, but I want to the game to have different lighting levels, for example, if I were to create a day and night cycle. However, I want to be able to cut holes in the lighting/foreground, or do something so that I can make certain parts of the screen lit up, for example like a flashlight or candle. Note: I'm also using the P5.js library.
The most obvious idea that came to mind for going about in creating a foreground is just creating a rectangle with some opacity that covers the entire screen. This is good, but how am I supposed cut through this? Obviously, the code below won't work because I'm just layering on another element, and the rectangle is still obstructed and not perfectly clear.
...ANSWER
Answered 2022-Jan-22 at 03:11The erase()
function may be what you are looking for. It is more flexible than trying to explicitly paint over the areas you want to cover (such as in the approach of using the stroke of a circle and rectangle to cover everything except a circle). And it is easier to use than beginContour()
since you can use it with any of the built in drawing primitives (rect, ellipse, triangle, etc).
QUESTION
I Am New To Ursana Engine And I Don't Know It Properly. But I Can Make Games In It. But The Problem Is That My Game Doesn't Have Any . So My Game Looks Dead.
Is There Any Way To Make My Game Look Good Using In Ursana Engine?
...ANSWER
Answered 2021-Dec-11 at 20:32You have to add lights and also apply lit_with_shadows_shader
to entities that will receive shadow.
See more here: https://www.ursinaengine.org/cheat_sheet.html#DirectionalLight
QUESTION
I have a group of related variables in a struct, each struct member is of basic type. I declared a uniform of that struct type, and want to use foo.a
, foo.b
, etc in my shader.
ANSWER
Answered 2022-Jan-14 at 05:50For structures the uniform locations are sequential and ascending. See 4.4.3. Uniform Variable Layout Qualifiers:
Locations can be assigned to default-block uniform arrays and structures. The first inner-most scalar, vector or matrix member or element takes the specified location and the compiler assigns the next inner-most member or element the next incremental location value.
QUESTION
I'm using the technique described here (code, demo) for using video frames as WebGL textures, and the simple scene (just showing the image in 2D, rather than a 3D rotating cube) from here.
The goal is a Tampermonkey userscript (with WebGL shaders, i.e. video effects) for YouTube.
The canvas is filled grey due to gl.clearColor(0.5,0.5,0.5,1)
. But the next lines of code, which should draw the frame from the video, have no visible effect. What part might be wrong? There are no errors.
I tried to shorten the code before posting, but apparently even simple WebGL scenes require a lot of boilerplate code.
...ANSWER
Answered 2022-Jan-08 at 15:24Edit: As it has been pointed out, first two sections of this answer are completely wrong.
TLDR: This might not be feasible without a backend server first fetching the video data.
If you check the MDN tutorial you followed, the video object passed to texImage2D
is actually an MP4 video. However, in your script, the video object you have access to (document.getElementsByTagName("video")[0]
) is just a DOM object. You don't have the actual video data. And it is not easy to get access to that for YouTube. The YouTube player do not fetch the video data in one shot, rather the YouTube streaming server makes sure to stream chunks of the video. I am not absolutely sure on this, but I think it'll be very difficult to work around this if your goal is to have a real time video effects.
I found some discussion on this (link1, link2) which might help.
That being said, there are some issues in your code from WebGL perspective. Ideally the code you have should be showing a blue rectangle as that is the texture data you are creating, instead of the initial glClearColor
color. And after the video starts to play, it should switch to the video texture (which will show as black due to the issue I have explained above).
I think it is due to the way you had setup your position data and doing clip space calculation in the shader. That can be skipped to directly send normalized device coordinate position data. Here is the updated code, with some cleaning up to make it shorter, which behaves as expected:
QUESTION
It is a kind of weird phenomena that I found out. There is a very simple example, I have an ARSCNView
which is empty, just rootnode and camera, so it means that the camera is open, but there is nothing on the screen (just camera).
There is a method that I call from the viewDidLoad() { printAllScene(node: scnView.scene.rootNode) }
in order to print all the nodes on the scene
ANSWER
Answered 2021-Dec-29 at 22:13Do you have the automaticallyUpdatesLighting
property set on the view?
From the documentation:
If this value is
true
(the default), the view automatically creates one or moreSCNLight
objects, adds them to the scene, and updates their properties to reflect estimated lighting information from the camera scene. Set this value tofalse
if you want to directly control all lighting in the SceneKit scene.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Lighting
Download the latest zip file, extract the binary, and drag into your Application folder.
Open "Lighting.app" and login with your personal access token.
Open Notification Center and add the "Lighting" widget.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page