# ldeej

Member

275

308 Neutral

• Rank
Member
1. ## 3D model types

Several options: FBX .X dotXsi Collada

3. ## SAH and kd trees

Quote:Original post by solinent I think so. So I should have a structure to store the splitpositions simillar to the following: struct SplitPosition { float pos; bool isStart; }; ... Something like that, you also need the element index (or pointer or something) to make sure that you can actually build the left and right lists, then keep going recursively This site might also help you: http://www.pbrt.org/ The book referenced there has code for how to build the kd-tree, and luxrender might be another good resource
4. ## SAH and kd trees

Quote:Original post by solinent Just a Q: how would one sort triangles left to right? I'm confused. Currently, I sort them either to the left or right for every single splitting position. I'm sure there's a better way? It takes a long time (maybe 1 min) to determine all the left/right counts. It would be painfully obvious if no objects straddled the splitting position, but this is clearly not the case. Thanks! It should work the following way: 1. Create an axis aligned bounding box for each triangle 2. For each split axis (x,y,z) Sort the boxes in question on the chosen axis, choosing the start plane At this point you have a list of boxes sorted on the given coordinate 3. Visit the list of boxes linearly Initialize the number of elements on the right of the splitting plane to be equal to the number of boxes For each start bounds +1 to the total count for the items on the left of the current splitting plane For each end bounds -1 to the count of boxes to the right of the splitting plane Find straddle by doing left+right-total Compute SAH for the current split position Choose every single start and end bounds as a possible split plane Does it make sense?
5. ## SAH and kd trees

Be careful with the overhead, the best way to tell is by profiling the code. You will be spending most of your time inside kd-tree traversal, and a fraction on ray/primitive intersection, everything else should be minimal, so spend time optimizing where it matters
6. ## What is the best method for static lighting?

Merging is tricky, hard to explain here... The route I would take (which is the route most people take) would be following: 1. Have your artists create the content normally (they can use multiple textures, with multiple uv mappings) 2. Pass the content through a mapper (i.e. UVAtlas) to create a new set of uvs for lighmapping purposes only 3. Run your lightmapper on the data at hand, for each pixel sample find which triangle owns it, and from there use the barycentric coordinates to find the 3d position 4. Offset the 3d position based on the normal a little bit to make sure you do not hit the triangle itself (there are other ways to do this) 5. At runtime use your shader to compute your diffuse color normally, sample the lighting texture(s) with the uv coordinates that are used for lightmapping only and the compute dynamic lighting on top of that Does it make sense to you? Let me know if you are still confused, I can probably explain other things if you are not sure how this is supposed to work. Note that there are other ways of doing it.
7. ## SAH and kd trees

If you have a 30 million triangles mesh then you have bigger problems. Not only do you have the cost of the kd-tree (which per-node could be 4 bytes if you are linearizing the tree or 8 bytes if you have a single explicit link), you also have to store the chosen triangle structure (Wald or Moller triangles or something else) The SAH can be done the following way: 1. Sort the elements from min to max on the axis tested (NlogN) 2. Visit the list once, compute left, right, straddle for each element and compute cost 3. Return cost for each axis, choose the best axis, keep going recursively For 30 million triangles it might be fairly slow, note that you can potentially multi-thread cost function for each axis. Look for papers written by Ingo Wald, you need to be careful with axis aligned triangles, make sure you have a bonus heuristic for empty space and for perfect splits (no straddle), ompf.org is a good resource
8. ## Is there a scripting language that works with C#?

There is also IronRuby, and LuaPlus
9. ## What is the best method for static lighting?

That is a pipeline problem, and not a lightmapping problem. You can do one of the following: 1. Use the exported mesh with the diffuse uvs and process it to add a new set of uvs for lightmapping (you can do this using UVAtlas) 2. Use your content creation software to allow exporting a mesh with two uv sets (Most DCC apps allow you to do this, Maya, Max, etc, etc) 3. Merge the meshes, this is tricky since you might need to split triangles due to different uv coordinates
10. ## What is the best method for static lighting?

You use different uv sets for different purposes, you can dedicate one for lightmaps only. i.e. uvset 0 is for lightmaps uvset 1 is for diffuse texture 1 uvset 2 is for diffuse texture 2 On your shader you compute your diffuse from reading your textures using uvsets 1 and 2, for your lighting computations you sample your lightmap using uvset0 When you Atlas you generate a brand new set of uv coords, which have nothing to do with artists mapping their regular materials Does it make sense?
11. ## Wild Magic Application Design

BTW - You are not going to find an engine that could be described to have a "perfect design", all the engines out there lack in terms of design on different fronts, and depending on the way they are architected then you can have several different issues on how they are structured, and there is always some scenario that you could come up with that would not fit well with the design in question
12. ## What is the best method for static lighting?

Lightmapping is not a dated method, is actually widely used in several popular games. You can simply use regular lightmapping, using something like Microsoft's UVAtlas to generate your texture space coordinates, and the run a glorified raytracer from there. Depending on how fancy you want to go (bounce light, etc, etc), then you might need to do multiple passes. It is possible to speed up the generation process using the GPU, specially for direct lighting, do a search for "GPU lightmaps" and you should find a few samples on how to do this.
13. ## my approach for kd tree.

Use Aligned boxes instead of spheres, and google for Surface Area Heuristic (SAH) for a good strategy to build your kd-tree If your tree needs to be updated constantly then kd-trees are a bad choice, and Bounding Volume Hierarchies are better (BVH)
14. ## EA Tiburon

Quote:Original post by frob There are lots of SE2 and SE3s there who know the pay. You might consider directly asking several of them for ranges. I think that is the reason some people post here, because they do not know anybody that works there and during the technical interview you should not bring up the salary question. I think what black_eagle is trying to do is trying to find sombody that works there here in the forum that is willing you give him/her a range
15. ## EA Tiburon

I did some research few months back, and I could not find any references in terms of salaries. QOL seems to vary there, rumors are that the Superman team went through a tough time towards the end of the project. Have not heard much recently