graphics

Shadow Volumes in WebGL/GLSL

泪湿孤枕 提交于 2020-01-25 08:14:26
问题 I am trying to implement shadow volumes using webgl and glsl for shaders. Currently I have a cube floating above a green ground with light coming from above but I am completely unaware of how to begin the implementation of shadow volumes. If anyone has any helpful tutorials or advice that would be greatly appreciated. I am fascinated by Shadow Volumes (not Shadow Maps) and really want to learn how to create them. I understand the general procedure to be: Perform ambient rendering pass Choose

Graphics.CopyFromScreen from Web = The handle is invalid

五迷三道 提交于 2020-01-25 00:45:40
问题 In an asp.net app, I try to get screenshot of server. Code works OK in VS.NET's web server but on IIS (even on local) I get the error. I've tried checking WWW Service's "Service Interacts with Desktop" property but didnt work. Any ideas? 回答1: I think the IIS server runs as a service so there's no Desktop to get a handle to, im not sure how that would work. 来源: https://stackoverflow.com/questions/1450022/graphics-copyfromscreen-from-web-the-handle-is-invalid

Changing size of axis labels in hexbin plot

拟墨画扇 提交于 2020-01-24 22:58:13
问题 Is there a way to change the font size of axis labels when plotting hexbin data? library(hexbin) myData <- hexbin(rnorm(100), rnorm(100)) myPlot <- plot(myData, xlab = "Variable 1", ylab = "Variable 2") 回答1: You can suppress the labels and add them separately with grid commands. It may take some trial and error to position them exactly where you want them: library(grid) myPlot <- plot(myData, xlab="", ylab="", lcex=.75) grid.text("Variable 1", .45, .1, gp=gpar(fontsize=12)) grid.text(

Changing size of axis labels in hexbin plot

北战南征 提交于 2020-01-24 22:58:07
问题 Is there a way to change the font size of axis labels when plotting hexbin data? library(hexbin) myData <- hexbin(rnorm(100), rnorm(100)) myPlot <- plot(myData, xlab = "Variable 1", ylab = "Variable 2") 回答1: You can suppress the labels and add them separately with grid commands. It may take some trial and error to position them exactly where you want them: library(grid) myPlot <- plot(myData, xlab="", ylab="", lcex=.75) grid.text("Variable 1", .45, .1, gp=gpar(fontsize=12)) grid.text(

VGA pixel grouping on STM32

冷暖自知 提交于 2020-01-24 22:57:13
问题 I have some code that displays a single pixel on screen through VGA but am a bit stuck on how I could set multiple pixels on screen where I want them. I set up two Timers for Vertical Sync and Horizontal Sync then using the V-Sync interrupt, I set a flag to allow PA8 to toggle and output a pixel at the correct timing based on the SetCompare value I set on the timer's channel. The STM32f103c8 is also overclocked to 128MHz. Here's the code: #include "Arduino.h" //640x480 at 60Hz static volatile

Setting a Frame Size and Location in Tkinter

半腔热情 提交于 2020-01-24 19:43:25
问题 I am trying to set a frame-size and the location of the frame (master widget) in Tkinter. Based off of this answer, I added this to my code: from Tkinter import * import ctypes user = ctypes.windll.user32 screensize = (user.GetSystemMetrics(0), user.GetSystemMetrics(1), user.GetSystemMetrics(2), user.GetSystemMetrics(3)) class GetWord: def __init__(self, master): master.geometry("%s+%s+%s+%s" % (screensize[0], screensize[1], screensize[2], screensize[3])) # I added the above in, but not sure

Pixels Array Too CPU Intensive

断了今生、忘了曾经 提交于 2020-01-24 18:57:46
问题 I have been working on a Java 2D game for a little while. It is a raster graphics system with an array of pixels (integers). private BufferedImage image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); private int[] pixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData(); I then create an array of integers separately, manipulate it with the screen objects (rendered from external image files, such as .png), then copy that array into my main one, which is projected

VB.NET - Movement Blocked due to Faulty Collision Detection

£可爱£侵袭症+ 提交于 2020-01-24 16:27:06
问题 So, I am making a game for my programming class as part of my final project. I'm just in the planning and experimenting stage at the moment and I decided to get a headstart on graphics and collisions. I first made my program just by experimenting with the Graphics class VB has to offer, instead of using PictureBox es. Alongside that, I added keyboard input to move an Image around. When I decided to add collision detection through the intersectsWith() method of the Image class, things became

Can memory imported to Vulkan from another API be freed by Vulkan?

狂风中的少年 提交于 2020-01-24 15:08:06
问题 On POSIX systems, one can import memory objects from other APIs through file descriptors using VkImportMemoryFdInfoKHR (it works similarly on Windows using VkImportMemoryWin32HandleInfoKHR ). Once the memory object has been imported, is Vulkan allowed to free the underlying memory with vkFreeMemory , or can the memory only be freed by the API that has allocated it? Thank you for your help! 回答1: Vulkan is not merely allowed to free the VkDeviceMemory object; it is required to do so. When you

OpenGL Driver Monitor says textures are rapidly increasing. How to find the leak?

*爱你&永不变心* 提交于 2020-01-24 09:32:35
问题 When I run my app, OpenGL Driver Monitor says the Textures count is rapidly increasing — within 30 seconds the Textures count increases by about 45,000. But I haven't been able to find the leak. I've instrumented every glGen*() call to print out every GL object name it returns — but they're all less than 50, so apparently GL objects created by glGen*() aren't being leaked. It's a large, complex app that renders multiple shaders to multiple FBOs on shared contexts on separate threads, so