7

Short answer: Yes, It can be done. But no one does so. Long answer: Scene graphs can be stored and processed on a GPU using OpenCL/WebCL. But it is not practical to do so. Updating scene graphs (a tree not in flat memory) on a GPU is slow, and processing it on a GPU is also slow (again, the tree is not in flat memory), while computing transformation ...


5

Forking defeats Russian Roulette A key difference between path tracing and ray tracing is that unlike ray tracing, which can have a branching tree of rays splitting at each intersection, path tracing follows a single path with no recursive branching. Russian Roulette requires that only one recursive function call be made each time through the function. ...


5

PhysX is a C++ API and can thus not directly be integrated with the JavaScript-based WebGL. Depending on your needs, you have the following options: Use a JavaScript-based physics engine, mostly suitable for 2D use cases. Use a Game Engine that can export for the web (e.g. Unity 3D) and build your application in there, using full 3D physics capability. ...


4

Okay, I figured it out. It has to do with the texture not loading before the first display function is called. The texture displays after a mouse or keyboard event. To remedy this, I added a timer to refresh the scene. This only works on Firefox however. I'm not sure why the image does not display on Chrome.


3

Yeah, that makes sense. Most flat panel monitors on the market have a 60Hz refresh rate! So you are not going to be able to flicker faster than 60Hz due to technical limitation. Were you to do this with a electron sweeping oscilloscope, or a LED lamp connected to a PWM source fast enough then no problem (you can find this in arduino samples). It would work. ...


2

There does not seem to be a single answer for this question, but I will try to give some directions in possible solutions. First of all I presume that "the scene graph technique" means storing the object data in some kind of data structure (I know what a scenegraph is, but there are many different possibilities for indoor/outdoor scenes etc). There seem to ...


2

This is a pure optimisation problem. It depends on many factors like: What you need to do with the tween How many different tweens you need to calculate How much signaling between systems you need Whether you need to use that data in your CPU bound process or not. How much time you have to write the code What your tool set supports easiest ... See if you ...


2

What you have here is an underconstrained problem*. To solve this problem you do what you do to any other underconstrained system. This is also why you mostly only see the 2 joint version as it is not underconstrained in the planar solution, and in any case the preregistration is trivial. Basically you have 2 options: Add more constraints Deal with the ...


2

Straight from the specification of lineTo: If the object's path has no subpaths, then ensure there is a subpath for (x, y). And "ensure that there is a subpath" links to this bit: When the user agent is to ensure there is a subpath for a coordinate (x, y) on a path, the user agent must check to see if the path has its need new subpath flag set. If it ...


1

The problem you are seeing, i.e. "jaggies" or "staircasing", is an example of the more general problem known as "aliasing" and, in the graphics field, the term you want to search for is "Antialiasing". Aliasing occurs when you undersample a signal. If a signal contains frequencies at or above the Nyquist Frequency, which is 1/2 the sampling frequency, ...


1

Your code, as seen on your post at the time of posting this answer, looks sort of like this (the following was thrown together rather quickly and may or may not work) : function fill ( x, y, touched, elem ) { if ( count <= 0 ) return; if ( isOutOfBounds(x,y) ) return; const idx = y*24 + x; if ( gArr[idx][0] != 0 || touched[idx] ) return;...


1

To get a proper circle, you can use a transformation matrix to transform your cell coordinates into equally spaced cartesian coordinates. In the case of your 50 x 100 pixel cells, your transformation matrix would probably either double the width or halve the height. So something like this: | 0.5 0.0 | | 0.0 1.0 | If you want to draw a circle of radius r at ...


1

In pseudocode For each rectangle: If the rectangle overlaps the selection area, highlight the rectangle This is all that is required for a correctly working approach, but there are a number of other things you might need to take into account if this approach performs too slowly. I recommend implementing the simple approach, and once it works correctly ...


1

I would have done it with a script and NETPBM like so: 1) reducing Image1 (the tiles) to size X by X -> Image1R 2) recording the mapping from pixel values of Image1R to coordinates (no need to worry about duplicates as an exact RGB match of two or more averaged pixels is unlikely) 3) remapping Image2 using Image1R as the color map -> Image2M 4) reading ...


1

A gpu only cares about the full transform used for a particular object. It's much better that the CPU (webworker) collates the transformation hierarchy into a single matrix. What you can do is use UBO and create a block where the final transform is stored and as you traverse the scenegraph update the data on the gpu. In the vertex shader you then index into ...


1

Ok, I've found the solution myself. It goes like this: // create shape shape = new THREE.Shape(); // move it to first point of the chord shape.moveTo(0+(RADIUS-2)*Math.cos(-1.4639537206164), 0+(RADIUS-2)*Math.sin(-1.4639537206164)); // create all the parts afterward shape.absarc(0, 0, (RADIUS-2), -1.4639537206164, -1.3041396376011, true); shape....


1

In the end I decided to use Leon Sorokin's RGBQuant.js for quantization, because it offered better flexibility over the color histogram/clustering method. I'm probably going to convert the quantized palette RGB output to HSV and implement custom clustering that picks out the "highlight" colors, favoring diversity of hue for colors with high value and ...


1

It appears that Microsoft has punted on this in Windows 7: This is the method available in the control panel for selecting what layout ClearType uses. Additionally, it seems that iOS and the Windows modern UI style de-emphasize subpixel antialiasing heavily, due to the prevalence of animations and screen rotations. As a result I expect the OS vendors to ...


Only top voted, non community-wiki answers of a minimum length are eligible