Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Learning Math For 3D Programming

Name: Anonymous 2011-09-02 15:40

Using this book: http://www.amazon.com/Mathematics-Programming-Computer-Graphics-Third/dp/1435458869

I'm trying to learn so that I can write a simple ray tracer. Once I've done that, I want to write a path tracer and then implement metropolis light transport as a semester project for a class.

The only problem is I've never done any kind of graphics programming before, so I have no idea if my craptop is going to be a huge problem. It has integrated graphics and an intel core 2 with 2 cores running at 1.66ghz. I figure that this will be fine because ray tracing is more dependent on the CPU than the GPU, isn't it?

Just don't want to put in the work and then have to buy a new computer, I'm fucking broke.

Also, how feasible is it to do this in C#? My class is titled "Computer Graphics", but it is taught by a CIS professor, and there are 9 CS students and over 20 CIS students in the class, so it covers precisely nothing that one would expect to find in a CG class, and is really just an introduction to C# and XNA, with a semester long C# project to go with it. The entire first month is going to be spent on fucking C# syntax and collections in a 4000-level class.

I need something cool to do graphics-wise in C# here. I don't want to write a shitty space shooter. I can't even install XNA on my computer, anyway, as it doesn't support shaders, so I have to borrow a computer for the XNA assignments. If a cool ray tracer isn't feasible, what is?

Name: Anonymous 2011-09-04 4:54

>>4,11
Nice advice/direction, but it's wrong. WRONG. Object-oriented math primitives are WRONG. You won't see any professional game developer doing this anymore.

They just write a thin abstraction layer over top of the target platform's SIMD intrinsics, and keep their vector types as a typedef of the underlying SIMD vector type. Then they build their generic portable C/C++ version to match the same interface, after the fact.

On x86/x86-64, it's something like: typedef __m128 float4;

2D/3D/4D vectors are just float4. Ray's are just float4. Planes are just float4. A bounding sphere representation is just a float4. an axis-aligned bounding box is two float4s. A 4x4 matrix is an array of four float4s.

Behavior is implemented through free functions and they look similar to something like GLSL/HLSL graphics shader math functions. Using OOP for this is just going to end up resulting in a bunch of useless boiler plate for something that is 10x slower than what you could have with a SIMD optimized math library as well as more difficult to use.

Read this OP: http://www.gamasutra.com/view/feature/4248/designing_fast_crossplatform_simd_.php

Then read about SoA vs AoS order for vector processing.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List