Jump to content
  • Advertisement

jonathanc

Member
  • Content Count

    159
  • Joined

  • Last visited

Community Reputation

100 Neutral

About jonathanc

  • Rank
    Member
  1. Hi all, Perhaps this could be a noobish question but I have to ask :p I have a simple 3D space game where my space ship can move freely in the 3D space. I want to show the ships current speed. The ships movement etc is represented by a 3D Vector. At the moment I have the "forward" velocity as vel.z but I notice that is not accurate once I start to pitch and yaw around. In 2D applications its simple enough but I am not sure how to do it here... Any advice? Cheers.
  2. jonathanc

    Global Illumination techniques

    Wow, thanks so much for the helpful replies! Well I am looking to achieve a simple, efficient GI effect. As I have moving water in the terrain I presume that I would need caustics as well? I am looking to implement direct and indirect lighting for the terrain. As for real time, I won't have any arbitary object moving but I will include procedurally generated vegetation, such as billboard grass and trees. I am not sure if I will animate them at this point. I am also not sure what lighting model to implement for them! Sorry for all the newbish questions, it seems that GI is a very large area and I am still trying to absorb all the various different algorithms and techniques. Did you guys have a look at my Youtube demo? I used a very simple lighting method in that and its pre calculated everytime the terrain is "morphed". So there's no self shadowing etc and it looks pretty bland. The reflections/refractions on the water looks bland too. I am hoping to apply some sort of "sparkling" effect to the water when reflecting sunshine and also a radiosity like effect on the terrain (and the vegetation I would add in the future).
  3. jonathanc

    Global Illumination techniques

    Quote:Original post by KRIGSSVIN Must GI be fully dynamic or may it be pre-computed? Well my demo will use a procedurally generated terrain so I am hoping of achieving the same with the GI, so I guess it has to be dynamic? Correct me if I am wrong though.
  4. Hi all, I am a beginner in graphics programming and I am currently researching into lighting methods. I have created a procedurally generated terrain but it was lit using simple lighting technique. You can see the youtube video here : The demo is coded using C++ language and OpenGL API. I am now looking to extend the demo a bit by making it look more photorealistic whilst not loosing too much of its overall performance. Basically I want to implement GI algorithms into the demo and still have it run in real time. This research is part of my Honours year dissertation. I have been reading up on the basics of Global Illumination but I am hoping that you guys could suggest some websites/books that is suitable to read up on. Also, any suggestion on implementing my research would be very much appreciated. I am now looking at deferred lighting (http://www.infinity-universe.com/Infinity/index.php?option=com_content&task=view&id=105&Itemid=47), Imperfect Shadow Maps (), Light Propogation Volumes (http://www.crytek.com/fileadmin/user_upload/inside/presentations/2009/Light_Propagation_Volumes.pdf) and also some work on fast computation of GI on dynamic height fields (http://www.dgp.toronto.edu/~derek/abstracts.2009.html#NS09). They all look pretty good and I am wondering if it will be feasable to look into researching them keeping in mind that I have a limited time constraint of around 3 months. Thank you very much and Merry Xmas!!!
  5. Hi all, I am a beginner learning OpenGL and I really like it! I am looking to research into using Ray Tracing as a global illumination technique in my procedurally generated terrain demo. This is my demo (please watch in HD if possible) : I have been doing some reading but can't really find helpful information for this matter. Perhaps some texts and papers are a bit complex for me to understand :( Anyway, I am wondering if it is feasible to start researching this area? Hopefully I will get some opinion on this matter. Also, can anyone recommend me any good books to read in regards to this topic? Thank you.
  6. jonathanc

    Need your opinions

    @ the two posters above me Thanks for the comments. It started off by asking some members of another forum about this matter. I created a simple poll and asked them to post opinions after voting. Someone mentioned that I should try to sample opinions from different forums as well so here I am. I do take notes on what people say and try to use them in the argumentative essay I am writing. Perhaps the poll is there to help me keep track of what's what. Have to remember not everyone likes to leave comments and would rather just vote. And yes, I should have strutured the poll a bit different since there's obviously a big skew at the moment. I can't edit it now because then the previous results will be worthless. I would probably mention that when I asked for opinions on this matter in general, x number of people said yes as compared to y etc. Thanks for informing me about that though. I will try to improve in the future. edit: Edited the poll a bit so voters can leave brief comments. [Edited by - jonathanc on November 3, 2009 1:43:58 PM]
  7. jonathanc

    Need your opinions

    Aye, I have cross posted this in several gaming forums as well. Just interested to hear the developers take on this matter ;)
  8. jonathanc

    Need your opinions

    Hi all, I am currently in the process of writing an essay on gaming and how it impacts the society. As you may be aware, there are some negative news that links gaming to various crimes and tragedies. Do you think violent games or games that depict violent acts will corrupt society? Do such games somehow drive certain gamers to do something they wouldn't have done otherwise? I am just interested to know people's general opinion on this matter. Even though you are a casual or non gamer I would still like to hear your vote on this matter. This is not an strict statistical poll but rather an attempt at gathering people's general opinions using the internet as a medium. Thanks for all votes offered ;) link : http://www.misterpoll.com/polls/459189
  9. Hi all, First of all, I'm sorry if this is a trivial question. I have spent hours on this but still can't seem to find a solution. I have an old project that was compiled with the 1.4.9 version of Ogre with the addon MyGUI. I have downloaded the new version of Ogre (1.6.4) on this PC and decide to recompile the code. I had minor problems in the start but managed to actually compile but the program won't run. It won't render anything on the screen. Just opens a window and then crash. I checked Ogre.log and there's some errors that I have no clue how to rectify. Below are the errors from the Ogre log : 23:36:17: Parsing script DOF.material 23:36:17: Compiler error: object name expected in DOF.material(55) 23:36:18: Parsing script OffsetMapping.material 23:36:18: Compiler error: object unsupported by render system in OffsetMapping.material(18) 23:36:17: Parsing script Examples-Advanced.material 23:36:17: Compiler error: object unsupported by render system in Examples-Advanced.material(648) 23:36:17: Compiler error: number expected in Examples-Advanced.material(679): incorrect float constant declaration 23:36:17: Compiler error: object name expected in DOF.material(55) 23:36:20: Texture: Blockade.jpg: Loading 1 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1. 00:03:15: Mesh: Loading Blockade.mesh. 00:03:15: Texture: Blockade.jpg: Loading 1 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1. 00:03:15: Mesh: Loading Metal1.mesh. 00:03:15: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Metal in resource group General or any other group. in ResourceGroupManager::openResource at f:\codingextra\ogre\shoggoth_vc8\ogre\ogremain\src\ogreresourcegroupmanager.cpp (line 763) 00:03:15: Error loading texture Metal. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Metal in resource group General or any other group. in ResourceGroupManager::openResource at f:\codingextra\ogre\shoggoth_vc8\ogre\ogremain\src\ogreresourcegroupmanager.cpp (line 763) 00:03:15: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Metal in resource group General or any other group. in ResourceGroupManager::openResource at f:\codingextra\ogre\shoggoth_vc8\ogre\ogremain\src\ogreresourcegroupmanager.cpp (line 763) 00:03:15: Error loading texture Metal. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource Metal in resource group General or any other group. in ResourceGroupManager::openResource at f:\codingextra\ogre\shoggoth_vc8\ogre\ogremain\src\ogreresourcegroupmanager.cpp (line 763) 00:03:15: Mesh: Loading Material1.mesh. 00:03:15: Texture: MaterialPlanet.jpg: Loading 1 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1. 00:03:15: Mesh: Loading String1.mesh. 00:03:16: Texture: String1.jpg: Loading 1 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1. 00:03:16: Mesh: Loading OrgPlanet.mesh. 00:03:16: Texture: Org.jpg: Loading 1 faces(PF_R8G8B8,1024x1024x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1. (This is the last line in the log) The first 3 errors can be "fixed" by deleting the relevant .material files from the scripts folder. However, I can't seem to remedy the errors after that. I have double checked and I am sure that Metal.jpg is in the media/models folder but that doesn't seem to help. I have tried to remove Metal1.mesh but then I get a window saying the resource cannot be located. Any advice/input welcomed. Thank you.
  10. Hi all, Just looking for some ideas or opinions in regards to what I am attempting to research for my Honours dissertation. I am trying to achieve near photorealistec lighting for my demo. I currently have a procedurally generated terrain that is lit using a simple directional lighting. I have been reading up on the High dynamic range image based lighting method but I am not sure if its the right direction me. As a rough idea this is what I will basing my research on : As you can see its not what I would call realistic ;) I am planning to apply lighting effects onto it so it could maybe look close to something from Crysis. Can I achieve that without the use of extensive 3D models? Is it possible to generate the environment map procedurally? How would I set the properties for the material in the scene? The whole terrain mesh if drawn from a single texture at the moment. Sorry if these questions seem trivial. There's so much information to take in now and I am hoping someone could give me a nudge in the right direction. Thank you.
  11. jonathanc

    Simple High Score system

    Hmm, thanks for the suggestions. I can read from custom files using Ogre but I can't find much information about writing to a file. Someone suggested looking at TinyXML to export and import data using XML but I have no experience in XML at the moment. Also, I apologize if this question is posted in the wrong forum. Anyhow, I thank you all for the advice given!
  12. jonathanc

    Simple High Score system

    meh sorry a lil tired from coding the whole day I guess. In short, is there a possible way to implement a high score system without the need to read and write to/from a file?
  13. Hi all! I have made a simple game and now I wish to add a high score feature. I would like to avoid using the standard File I/O in C++ as apparently OGRE doesn't really like that. So I am thinking of a simpler solution. What I want to do is (assuming the player does not exit the game) : 1) in the game over state initialize highscore to 0 (first run) 2) set highscore variable in game over state to the current player score 3) player selects replay game and plays the game again 4) player returns to the game over state 5) compare the current player score with the highscore The problem I have is that highscore initializes to zero everything I enter game state since highscore=0; is called in GameOverState::Enter(). Any idea how if this is somehow possible? If not, is there any other simple solution since what I basically want to do is store a integer throughout the game and changing it only when another integer value is larger than its current. This of course is assuming the player doesn't exit the game. Thanks.
  14. jonathanc

    Interpolation function

    Hi again, I think I found a good youtube clip on what I want to achieve. Youtube example and the morph can best be viewed at around 1:36-1:42 Thanks again for any help you guys can offer!
  15. jonathanc

    Interpolation function

    Also posted the relevant bit of my Terrain/Heightmap class for reference. Hopefully someone can spot what I am missing >< thanks! #include "terrain.h" HeightMap::HeightMap() : m_size(0), m_gridSpacing(0), m_heightScale(1.0f) { } HeightMap::~HeightMap() { destroy(); } void HeightMap::generateDSFmoprh(float roughness, float time) { int p1, p2, p3; float t; float minH = 0.0f, maxH = 0.0f; generateDSfractal(roughness); for (int x = 0; x < m_size; x++) { for (int z = 0; z < m_size; z++) { p1 = heightIndexAt(x, z); m_heights1[p1] = m_heights[p1]; } } generateDSfractal(roughness); for (int x1 = 0; x1 < m_size; x1++) { for (int z1 = 0; z1 < m_size; z1++) { p2 = heightIndexAt(x1, z1); m_heights2[p2] = m_heights[p2]; } } for (int x1 = 0; x1 < m_size; x1++) { for (int z1 = 0; z1 < m_size; z1++) { p3 = heightIndexAt(x1, z1); for(t=0; t<=1; t+=0.1) { m_heights[p3] = (1-t)*m_heights1[p3] + t*m_heights2[p3]; minH = min(minH, m_heights[p3]); maxH = max(maxH, m_heights[p3]); } } } // Normalize height field so altitudes fall into range [0,255]. for (int i = 0; i < m_size * m_size; ++i) m_heights = 255.0f * (m_heights - minH) / (maxH - minH); } void HeightMap::generateDSfractal(float roughness) { srand(static_cast<unsigned int>(time(0))); std::fill(m_heights.begin(), m_heights.end(), 0.0f); int p1, p2, p3, p4, mid; float dH = m_size * 0.5f; float dHFactor = powf(2.0f, -roughness); float minH = 0.0f, maxH = 0.0f; for (int w = m_size; w > 0; dH *= dHFactor, w /= 2) { // Diamond Step. for (int z = 0; z < m_size; z += w) { for (int x = 0; x < m_size; x += w) { p1 = heightIndexAt(x, z); p2 = heightIndexAt(x + w, z); p3 = heightIndexAt(x + w, z + w); p4 = heightIndexAt(x, z + w); mid = heightIndexAt(x + w / 2, z + w / 2); m_heights[mid] = Math::random(-dH, dH) + (m_heights[p1] + m_heights[p2] + m_heights[p3] + m_heights[p4]) * 0.25f; minH = min(minH, m_heights[mid]); maxH = max(maxH, m_heights[mid]); } } // Square step. for (int z = 0; z < m_size; z += w) { for (int x = 0; x < m_size; x += w) { p1 = heightIndexAt(x, z); p2 = heightIndexAt(x + w, z); p3 = heightIndexAt(x + w / 2, z - w / 2); p4 = heightIndexAt(x + w / 2, z + w / 2); mid = heightIndexAt(x + w / 2, z); m_heights[mid] = Math::random(-dH, dH) + (m_heights[p1] + m_heights[p2] + m_heights[p3] + m_heights[p4]) * 0.25f; minH = min(minH, m_heights[mid]); maxH = max(maxH, m_heights[mid]); p1 = heightIndexAt(x, z); p2 = heightIndexAt(x, z + w); p3 = heightIndexAt(x + w / 2, z + w / 2); p3 = heightIndexAt(x - w / 2, z + w / 2); mid = heightIndexAt(x, z + w / 2); m_heights[mid] = Math::random(-dH, dH) + (m_heights[p1] + m_heights[p2] + m_heights[p3] + m_heights[p4]) * 0.25f; minH = min(minH, m_heights[mid]); maxH = max(maxH, m_heights[mid]); } } } smooth(); // Normalize height field so altitudes fall into range [0,255]. for (int i = 0; i < m_size * m_size; ++i) m_heights = 255.0f * (m_heights - minH) / (maxH - minH); } // Terrain. //----------------------------------------------------------------------------- Terrain::Terrain() { m_vertexBuffer = 0; m_indexBuffer = 0; m_totalVertices = 0; m_totalIndices = 0; } Terrain::~Terrain() { destroy(); } bool Terrain::create(int size, int gridSpacing, float scale) { if (!m_heightMap.create(size, gridSpacing, scale)) return false; return terrainCreate(size, gridSpacing, scale); } void Terrain::destroy() { m_heightMap.destroy(); terrainDestroy(); } void Terrain::draw() { terrainDraw(); } void Terrain::RunMorpha(float roughness, float time) { m_heightMap.generateDSFmoprh(roughness, time); return generateVertices(); } bool Terrain::terrainCreate(int size, int gridSpacing, float scale) { // Initialize the vertex buffer object. // OpenGL code here return generateIndices(); } void Terrain::terrainDraw() { //OpenGL drawing code that makes use of values generated from generateIndices and generateVertices }
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net 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!