Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

138 Neutral

About mlt

  • Rank
  1. I have the following cg shader (from the Ogre website): void main_plain_texture_vp( // Vertex Inputs float4 position : POSITION, // Vertex position in model space float2 texCoord0 : TEXCOORD0, // Texture UV set 0 // Outputs out float4 oPosition : POSITION, // Transformed vertex position out float2 uv0 : TEXCOORD0, // UV0 // Model Level Inputs uniform float4x4 worldViewProj) { // Calculate output position oPosition = mul(worldViewProj, position); // Simply copy the input vertex UV to the output uv0 = texCoord0; } void main_plain_texture_fp( // Pixel Inputs float2 uv0 : TEXCOORD0, // UV interpolated for current pixel // Outputs out float4 color : COLOR, // Output color we want to write // Model Level Inputs uniform sampler2D texture) // Texture we're going to use { // Just sample texture using supplied UV color = tex2D(texture, uv0); } when I compile it through the commandline (using Cg Toolkit 2.2) on windows 7 I get: C:\local\OgreSDK_vc10_v1-7-2\media\mystuff>cgc (0) : error C3001: no program defined 32 lines, 1 errors. Any ideas? Is there someway of getting better error into when using cgc?
  2. Anyone? Or is time better spend on: ??
  3. I cannot build the INSTALL goal in the Tutorial framework project (Using MS Visual Studio 2010 on windows 7). I have done the following: 1) Downloaded and extracted the prebuild OGRE 1.7.2 SDK for Visual C++ .Net 2010 (32-bit): 2) Add an environment variable OGRE_HOME pointing to the above sdk. 3) Downloaded and added the CMakeLists.txt to the Tutorial Framework - (Windows Line-endings): 4) Downloaded and build (both for debug and release) the Dependencies for VS: Copied the folder "Dependencies" to the src folder in the Tutorial project. 4) Downloaded and installed directX sdk: 5) build the project with CMake, opened the file: OgreApp.sln and build the ALL_BUILD target which completed with success. But when I try to build the INSTALL target I get: 1>------ Build started: Project: INSTALL, Configuration: Debug Win32 ------ 1>Build started 24-12-2010 16:20:53. 1>InitializeBuildStatus: 1> Touching "Win32\Debug\INSTALL\INSTALL.unsuccessfulbuild". 1>PostBuildEvent: 1> CMake Error at cmake_install.cmake:35 (FILE): 1> file INSTALL cannot find "C:/local/TutorialFramework/dist/Media". 1> 1> 1> -- Install configuration: "Debug" 1> The system cannot find the batch label specified - VCReportError 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command ""C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: if errorlevel 1 goto VCReportError 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code 1. 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:00.15 ========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ========== I guess this is the problem: file INSTALL cannot find "C:/local/TutorialFramework/dist/Media". that does not exist on my system. The correct path is: C:\local\TutorialFramework\build\debug\dist\media which exists. EDIT: The following : if(WIN32) set(CMAKE_MODULE_PATH "$ENV{OGRE_HOME}/CMake/;${CMAKE_MODULE_PATH}") set(OGRE_SAMPLES_INCLUDEPATH $ENV{OGRE_HOME}/Samples/include ) endif(WIN32) is not correct. The include folder under Samples is located in: OgreSDK_vc10_v1-7-2\Samples\Common\include have anyone had success building the project with the CMakeLists.txt file located at: ? [Edited by - mlt on December 24, 2010 9:36:54 AM]
  4. Hi guys I have been reading through the post on this forum and decided that I want to use Ogre for my small 3D hobby projects. I have a few questions: 1) Is it possible to write an environment/world (skydome, landscape, trees etc) from scratch using ogre or does it come with an already existing "world-base" that one needs to reuse? 2) I have written some cg vertex and fragment shaders for water rendering, can I reuse those in orgre? 3) Is it possible to add my own openGL code to Ogre (primary used for loading shaders and framebuffers)? Have a nice christmas!
  5. Some years ago I extended a small engine with some water effects (normal mapping and reflection) using openGL and Cg shaders. Development on this engine has more or less stopped so I was hoping to find another opensource project/framework where I can add my own shaders and geometries (eg. simulating water using displacement mapping on the GPU). I have also considered writing my own engine from scratch but maybe there are a better place to start or get help getting started? I does not necessarily have to be Cg shaders but I would like to continue working with openGL. Any suggestions? EDIT: What are your suggestions when it comes to: 1) HLSL with DirectX 2) CUDA Toolkit 3.2 with openGL 3) GLSL with OpenGL ? [Edited by - mlt on December 23, 2010 12:51:20 PM]
  6. A 3D cubic free form deformation can be expressed as: where \delta is the spacing between the control points \phi But why the expressions for i,j,k and u,v,w? My first ideas was that the world-coordinates (x,y,z) are transformed to the parametric space of the cubic basisfunction [0;1]. But I am not really sure about this interpretation. Any suggestions?
  7. What does an area where the gradient is 0 in an image look like? I would assume it would either be completly black or white but is correct?
  8. I have read that B-Splines are separable, but what does that mean? And does it not only make sense to talk about separable functions for 2 or more variables?
  9. mlt

    From 2D to 3D

    Hm I am still pretty stuch with solving the adjacent bucket/neighbor problem anyone got any good ideas here?
  10. mlt

    From 2D to 3D

    Yes I have made a kdTree implementation but I would like to compare it with a spatial hashing approach. Unless of course it shows that it makes no sense to use spatial hashing for this purpose (because of the problem with neighbors in adjacent buckets).
  11. mlt

    From 2D to 3D

    Ok thanks for the info! I also came up with this expression: int hashFun(queryPoint, CubeSize, split) = int x_dir = floor((queryPoint[0]/CubeSize[0])); int y_dir = floor((queryPoint[1]/CubeSize[1]))*split; int z_dir = floor((queryPoint[2]/CubeSize[2]))*split*split; res = x_dir + y_dir + z_dir; return res; which also gives the correct result. But I am facing a new problem. I use the above expression to create a hash-table. For each index (determined by the above expression) in the hash-table a lists of elements (points actually) that maps to the same cell is stored. Next I can use the hash-table to find the nearest-neighbors (list of points for a given index) for a give point p with: list l = hash_table[hashFun(p)] But if p is on the boundary of a cell some of its neighbors migh actually be located in the adjacent cell which will not be returned. One naive approach could be to check if the queryPoint is a "boundary" point meaning that its adjacent to another bucket within a specified radius. If this is the case the adjacent bucket is also returned (or some part of it). I would assume that I am not the first person to run into this problem, maybe someone know of more efficient way to solve this problem?
  12. mlt

    From 2D to 3D

    If I have a non-regular cube with the following dimensions: cubeSize = w*h*d = 128*128*88 which I would like to split into 8 subcubes (dividing by 2 along each dimension) each subcube would have the following dimensions: subCubeSize = w/2*h/2*d/2 = 64*64*44 Now for any point in the 128*128*88 space I am looking for an expression that assigns the point to the correct subcube numbered from 0 to 7. Currently I am trying : int x_dir = floor((queryPoint[0]/subCubeSize[0])); int y_dir = floor((queryPoint[1]/subCubeSize[1]))*split; int z_dir = floor((queryPoint[2]/subCubeSize[2]))*split; int cube_num = x_dir + y_dir + z_dir; where split is currently 2 which gives 8 subcubes. But using the above expression the two points: (32,75,32) and (32,32,50) Both maps to 2, which is not correct. Any ideas on what I am doing wrong? EDIT: I guees an alternative could be to create a boolean expression like: if (x<=cell.x && y<=cell.y && z<=cell.z) return 0; if (x<=cell.x && y<=cell.y && z>cell.z) return 1; if (x<=cell.x && y>cell.y && z>cell.z) return 2; ...etc. but maybe thats more expensive? [Edited by - mlt on November 30, 2009 10:07:03 AM]
  13. I am trying to implement a spatial hash function based on the approach below: in 2D their naive approach looks like this: int grid_cell = ( floor(x/cell_size) ) + ( floor(y/cell_size) )*width where grid_cell is the hash value. Now I would like to extend this to a non-regular 3D cube, except that I will keep the width (number of cells along each dimension ) the same: int grid_cell = ( floor(x/cell_size_x) )*width + ( floor(y/cell_size_y) )*width + ( floor(z/cell_size_z) )*width But I keep getting higher cell numbers than I have allocated. Any ideas on what goes wrong? Edit: More generally: When designing a hash-function one normaly wants to distribute the keys evenly in the array. But assume that the hashfunction should be used to create buckets of points in 3D space. Points that are neighbors should be located in the same bucket, while points far away from each other should be located in different buckets. Further the max and min location of points are known. As an example the points: (1,2,3), (4,3,2), (4,6,1) should hash to a bucket different than the points (10,20,30), (40,30,20), (40,60,10). Where do I find more information on creating this kind of hash-function that hash neighboring 3D points to the same bucket? [Edited by - mlt on November 28, 2009 6:39:13 PM]
  14. Quote:Original post by aryx How about std::multimap? You can use equal_range function to get the begin/end iterators for all elements with the same key (i.e., the "chain"). Hm good point. But I don't have any good experience with using iterators on a map compare to iterating a std::vector. Previously I iterated a std::map contaning approx 40-60 elements for each voxel in a 3D volume consisting of 512*512*512 and it was way slower than iterating the same number of elements in a std::vector.
  15. When multiple objects hash to the same value they are stored in a chain. Are there any hash-table implementation that returns the whole chain for a given hash value instead of the unique element in the hash-table? I need to use the hash-table as a spatial hash-table. Each object corresponds to a point in space. I have defined a hash-function that maps the point location to a hash value. Something like this: Now each chain in the hash-table will contain objects that are "neighbors". For a random point, p, I can use the hash-function to find the chain that store its neighbors. But I have not been able to find any hash-table implementations that returns the whole chain. As an alternative a std::map could be used where key is the hash-key and value is a list of objects with that hash-key. But then I get lg n time instead of constant time. Any suggestions/comments are welcome!
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!