Tag Info

Hot answers tagged

8

I am going to assume you already know some basic linear algebra, the kind involved in: 3d projections, camera setup, transforming vertices into world position, etc... If you don't, there are plenty of great places to learn from. Here are two that I like: Game Engine Architecture Brief coverage of basic linear algebra but does cover everything you need to ...


7

UV interpolation needs to take into account the depth of the vertices. You need to perform perspective-correct interpolation, which involves dividing by the w coordinate of the interpolated homogeneous vector. The "folded plane" effect of affine interpolation becomes more pronounced at wide FOV or when the camera is close to an object, but it's not ...


5

This is a pretty broad topic. There are two basic parts to it, though: the actual theory of the graphics transformation and rasterization pipeline, and the actual implementation bits that let you blast pixels on the to screen however you choose. On top of that, there is also optimization (particularly of the latter bit). The first part is fortunately the ...


5

GDI (Graphics Device Interface) is the software renderer under Windows. Basically any language/runtime platform under Windows that is not GPU-accelerated is going to be using GDI under the hood at some level. While Java AWT might use GDI directly via the C code that the Java runtime is written in, something like Flash running in Chrome will OTOH be using GDI ...


4

I took a quick look at your example and your code. You're extremely close to solving this, so I don't mind helping with a question that looks suspiciously like homework ;). In data.js, you are assigning the same UV coordinates to the front and rear faces of the cube. The coordinates seem to be ([0,0], [0,0.5], [0.5,0.5], [0.5,0]). This means that you can ...


4

I am confused at your requirements. Are you running the code on a PC or an embedded system? If you are running on anything that remotely looks like a PC the "any hardware rendering support" is basically simply not true. At the bare minimum you have some Intel integrated stuff. I have yet to see a headless system that physically did not have a video chip. ...


3

Actually, starting with Windows 7, Direct3D 11 is your answer. Of course the API defaults to using a GPU if you have one, but you can create a Direct3D device targeting the Windows Advanced Rasterization Platform (WARP), which is meant to be a high performance software rasterizer supporting the Direct3D API. You should not expect performance anywhere as ...


3

This is a valid approach normally known as the Painter's Algorithm. Sorting your triangles will not support overlapping triangles. By that I mean two triangles that overlap in a way such that half of one triangle is infront of the other, while the other is behind. If you don't need to support this, you could probably just do sorting back to front. That is, ...


3

Quick answer: Z is not a linear function of (X', Y'), but 1/Z is. Since you interpolate linearly, you get correct results for 1/Z, but not for Z. You don't notice because as long as the comparison between Z1 and Z2 is correct, the zbuffer will do the right thing, even if both values are wrong. You will definitely notice when you add texture mapping (and to ...


3

The proper way to determine if you can create a device of a particular type (hardware / software) with particular feature levels is to attempt to create a device with the options you want, and if that fails, fall back to a less-featured device. The documentation demonstrates this technique for feature level fallbacks, and you can apply a similar one for ...


3

If you pretend a pixel is a square (see A Pixel is Not a Little Square), then the center of that square is the pixel coordinate. This is documented in Direct3D 9's rasterization rules (emphasis mine): Direct3D uses a top-left filling convention for filling geometry. This is the same convention that is used for rectangles in GDI and OpenGL. In ...


2

descent uses a portal rendering engine this engine divides the world in convex rooms and the engine knows which room you are in then to render you render the rooms faces and for each visible face that is a portal you adjust the frustum and render the room that the portal links to in psuedo code: renderRoom(room) { foreach face in room { ...


2

Golden rule when you are using floating point: count on every calculation to have an error in the result. It looks like your texture mapping is mapping a bit of memory past the edge of the textures. This may be because of floating point error. This part catches my attention: z = (1/z); uv.u = Math.round(uv.u * z *100);//*100 because my texture is ...


2

I wouldn't we so fast in jumping to "there's no benefit" conclusion. Whilst GPUs are absurdly fast at processing triangles, not all of the images are made using triangle rasterization! For example, voxel-octree based renderers (used, for example, in medicine, for visualizing CT scans) often utilize multicore CPUs and write raw pixels basing on completely ...


2

It would seem only OpenGL 2.x is fully supported by the software renderer in Mesa. However, this answer suggests, that most of the functionality of OpenGL 3.x is supported via extensions. So, you might want to give it a try.


1

It is not in perspective because device_project (...) does not divide by w. Given a typical perspective projection matrix, the z component of the last row/column is usually +/- 1.0 and everything else in the row/column is 0.0. OpenGL Perspective Projection Matrix (right-handed eye-space --> left-handed clip-space):        ...


1

In some ways, rasterisation is the opposite problem to raytracing. In raytracing, you know which pixel you are testing, and you have to find the triangles that are hit by the ray through it. In rasterisation, you have information about a triangle and you need to find which pixels it covers. Basically, the vertices describing the triangle are projected into ...


1

Major 3D animation suites support writing custom plugins/extensions (scripts and/or .dll/.so files). For example Blender use Python for scripting (API). This may or may not be enough for what you are trying to achieve because not all [custom] data (e.g. colour changes you have mentioned) will be exported to supported formats thus you might be forced to ...


1

Dokkat, from my experience I can tell that Unity 3d Mecanim animation has a sophisticated system for all sorts of animations, with the Mecanim tools the ammount of code you MUST write is limited, but the sky's the limit. You have plenty options to choose from. http://docs.unity3d.com/Documentation/ScriptReference/Animation.html I have to note that it will ...


1

According to here For maximum speed, perspective correction is performed only every 16 pixels. This is normally fine, but it is possible to see texture ripples in surfaces that are viewed at sharp angles. For more precise texture mapping, set the console variable d_subdiv16 to 0. Doing this will result in somewhat slower performance, however, ...


1

Install a build of Windows 8 and disable your video card in device manager. The whole system will then be running using the 'Microsoft Basic Display Adapter' - which is WARP.



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