Advertisement Jump to content
  • Advertisement

ngill

Member
  • Content Count

    173
  • Joined

  • Last visited

Community Reputation

115 Neutral

About ngill

  • Rank
    Member
  1. ngill

    Rendering clouds from space

    I've thought about this stuff before... I think there was an article in Real Time Rendering (I think it was from there, not 100% sure though) about generating clouds from space -- procedurally. IIRC, the patterns looked realistic. Transition from 2D->3D is pretty tough though... so good luck on that. -Navreet
  2. ehn.. if you're new to cpp...templates, namespaces, setting up boost, are probably not the first things I'd be messing with. But if you're up to it, go for using my code above :).
  3. Boost has matrix multiplication support: http://www.boost.org/libs/numeric/ublas/doc/ it can do > 4x4 matrix multiplies... and is cross platform. If you're doing 4x4 matrix multiplay, use the D3D stuff... it's fast (it uses mmx/SSE2), the good guys at AMD, Intel helped them do that. Other than that, I recommend boost. Here's some code that uses it: boost::numeric::ublas::matrix<GLfloat> zenith_x_matrix(3,4), zenith_y_matrix(3,4); zenith_x_matrix(0,0)= 0.00166; zenith_x_matrix(0,1)=-0.00375; zenith_x_matrix(0,2)= 0.00209; zenith_x_matrix(0,3)=0; zenith_x_matrix(1,0)=-0.02903; zenith_x_matrix(1,1)= 0.06377; zenith_x_matrix(1,2)=-0.03202; zenith_x_matrix(1,3)=0.00394; zenith_x_matrix(2,0)= 0.11693; zenith_x_matrix(2,1)=-0.21196; zenith_x_matrix(2,2)= 0.06052; zenith_x_matrix(2,3)=0.25886; zenith_y_matrix(0,0)= 0.00275; zenith_y_matrix(0,1)=-0.00610; zenith_y_matrix(0,2)= 0.00317; zenith_y_matrix(0,3)=0; zenith_y_matrix(1,0)=-0.04214; zenith_y_matrix(1,1)= 0.08970; zenith_y_matrix(1,2)=-0.04153; zenith_y_matrix(1,3)=0.00516; zenith_y_matrix(2,0)= 0.15346; zenith_y_matrix(2,1)=-0.26756; zenith_y_matrix(2,2)= 0.06670; zenith_y_matrix(2,3)=0.26688; boost::numeric::ublas::matrix<GLfloat> ans(1,1); ans=prod(TT2T3,prod(zenith_x_matrix,thetaSunVector));
  4. ngill

    need help setting up VBOs

    thanks... I feel dumb for that. I am sure it caught a future bug, bug it didn't seem to make a difference for now :(.
  5. ngill

    need help setting up VBOs

    thanks, I forgot that I was actually inherting this class and had another draw function on top of it (was using glcolorpointer). fixed the memory errors... and the crash, and my fps counter is back too! however, the scene still isn't displayed correctly :( only part of dome is displayed..
  6. Hi guys... I am trying to port a small class from using Vertex/Index Arrays to VBOs. orginal code: void Dome::draw() { glMatrixMode(GL_MODELVIEW); glPushMatrix(); glScalef(radius,radius,radius); glVertexPointer(3,GL_FLOAT,0,(GLvoid *)vertPosArray); glEnableClientState(GL_VERTEX_ARRAY); for (GLuint i(0); i<numLats-1; i++) glDrawElements(GL_TRIANGLE_STRIP,(numLongs+1)*2,GL_UNSIGNED_INT,&indexArray[i*2*(numLongs+1)]); glDisableClientState(GL_VERTEX_ARRAY); glPopMatrix(); } new code: void Dome::makeVBOs() { check_opengl_errors("begin Dome::makeVBOs"); std::cout << "VBOverts is " << sizeof(GLfloat)*numVertices << " bytes large." << std::endl; glGenBuffersARB(1,&VBOverts); glBindBufferARB(GL_ARRAY_BUFFER_ARB,VBOverts); glBufferDataARB(GL_ARRAY_BUFFER_ARB,sizeof(GLfloat)*numVertices,vertPosArray,GL_STATIC_DRAW_ARB); std::cout << "VBOindices is " << sizeof(GLuint)*numIndices << " bytes large." << std::endl; glGenBuffersARB(1,&VBOindices); glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,VBOindices); glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB,sizeof(GLuint)*numIndices,indexArray,GL_STATIC_DRAW_ARB); assert(glIsBufferARB(VBOverts)==true); assert(glIsBufferARB(VBOindices)==true); check_opengl_errors("end Dome::makeVBOs"); } #define BUFFER_OFFSET(i) ((char *)NULL + (i)) void Dome::draw() { check_opengl_errors("begin Dome::draw"); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glScalef(radius,radius,radius); glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBOverts); glVertexPointer(3,GL_FLOAT,0,0); glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, VBOindices); glEnableClientState(GL_VERTEX_ARRAY); for (GLuint i(0); i<numLats-1; i++) glDrawElements(GL_TRIANGLE_STRIP,(numLongs+1)*2,GL_UNSIGNED_INT,BUFFER_OFFSET(i*2*(numLongs+1))); glDisableClientState(GL_VERTEX_ARRAY); glPopMatrix(); check_opengl_errors("end Dome::draw"); } The program runs for a few frames drawing nothing (not even my fps counter), and then this happens: ./main VBOverts is 360000 bytes large. VBOindices is 719992 bytes large. compute colors took: 133 ms. GL ERROR begin Dome::draw: out of memory GL ERROR begin Dome::draw: out of memory GL ERROR begin Dome::draw: out of memory make: *** [exec] Aborted Any ideas?? Thanks
  7. ngill

    Terrain Rendering Techinques

    widely used != good ROAM is a relatively complicated algorithm when you compare it to others. This just means more bugs to track down, and you need to do a bajillion things to get the frame rate to not suck. I'd try Geometry clipmaps. Other algorithms can be found at: http://vterrain.org/LOD/Papers/index.html
  8. ngill

    Creating Nebulae

    you could try looking for Homeworld 2 Nebulae: I have to run, but there might be some discussion about how they do it somewhere. Try searching for it. It looked like they were able to get good looking nebulae at very low frequencies too.
  9. ngill

    Geometry clipmaps?

    I hear there is a chapter in GPU Gems 2 book. You could go buy it, or go to a bookstore and read the article (if you are a poor student).
  10. ngill

    Geometry clipmaps?

    is there anything in particular you'd like need help with? or just the general overview? I have a movie on my desktop that they used to show off their results, it also talks about a very high level overview of the algorithm. Would that be helpful?
  11. what about the projection matrix? seems that way would be the easiest.
  12. ngill

    Large Open Terrains

    Quote:Original post by bobNinjaPenguin Also what is Geo Mipmapping like for really really large terrains? A memory hog. really -- try the geometry clipmaps
  13. ngill

    Geomipmapping?

    Geomipmapping is OK, but if you have BIG heightmaps, they don't work very well. The memory requirements are too much (unless you're sitting on an opteron with 8 gigs of ram or something). Try Geo clipmaps for bigger meshes.
  14. I don't think there's a quick fix... otherwise you can solve stuff like radiosity really cheaply. :) --Navreet
  15. ngill

    Realistic looking earth

    It all depends on definition of realistic. Advanced stuff can contain multiple procedural algorithms, LOD algorithms, and a library of shaders. Basically, a year of development from a dedicated programmer.
  • 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!