Jump to content
  • Advertisement

stein

Member
  • Content Count

    194
  • Joined

  • Last visited

Community Reputation

164 Neutral

About stein

  • Rank
    Member
  1. The size of your heightmap has nothing to do with the 'physical' size of your terrain - except that you usually need a higher resolution heightmap for large terrains. But again, this only applies if you need to view the terrain 'close'. It's perfectly up to you to decide if one pixel should translate into 1.0u, 0.1u or even 100.0u - in your 3D world. It makes no difference whether you scale your terrain up, or scale everything else down. I typically work with 1:1 scale with meters though. If your textures look bad when stretched over the entire terrain, then you either need to make your texture higher resolution, or use several textures for the terrain. I don't see why you can't have proper alpha blending though. You should have 8 bits for each channel, which should do just fine. Or am I missing your point? I assume you're using a pixel shader for this?
  2. You should use the inverse of your model matrix. I think there's some naming-confusion in your shader? // Used for converting to model space mat3 modelToWorldMatrix; Anyways... The model matrix (which should be called something like modelToWorldMatrix) is the one you're tranforming your objects with. Take the inverse of this, and you'll have your worldToModelMatrix. Now transform you lightvec (which should be in worldspace), and you'll get your light vector in objectspace (ready for normalmapping). Also, you should consider normalizing your lightvec per pixel (it will not stay normalized when doing linear interpolation).
  3. stein

    What the heck? (SM issue)

    Did you do like this? RENDER_gamescene(){ glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); for(x;;;){ glPushMatrix(); glTranslatef(x,y,z); glBindTexture(GL_TEXTURE_2D,TEXTURES[x].data); renderobject(x); glPopMatrix(); } glDisable(GL_TEXTURE_2D); glActiveTextureARB(GL_TEXTURE0_ARB); }
  4. stein

    What the heck? (SM issue)

    You should bind your diffuse textures to a different texture unit than your shadowmap. I think that should help :) Put a glActiveTextureARB(GL_TEXTURE1_ARB) in your rendergamescene. But there seems to be some confusion, judging by your function names...
  5. Quote:Original post by Badgerr The only problem I can see is this: *** Source Snippet Removed *** Should be the other way around, I think :)
  6. Quote:Original post by cherryyosh I more the likly will add frustum culling later, but right now it would be pointless, so I am looking for other ways to optimize drawing the shadows to the scene. If it's pointless to add frustum culling, then why do you want to optimize? What's the problem at hand?
  7. Let's agree to disagree then :)
  8. Quote:Original post by Numsgil Quote: Besides, I'd consider this sort of a deroute. Why not create an 'output'-class, and pass it to your tests? This output-class (interface) could have various implementations. One that logs to a console, one that logs to a file etc... That's over engineering the problem. I disagree. It's done in about 2 minutes. It adds great flexibility. It requires no change in client code. What's over-engineered about it?
  9. Quote:Original post by biraneto Sorry... I thought your scene was something like an open area with trees, etc. Frustum culling is only usefull if you are not looking the whole thing all the time. Well, when using multiple shadowmaps, then they're hopefully not all 'looking'/covering at the entire scene :) So frustum culling would be good when rendering into the shadowmaps.
  10. Between storing 'string temp = output' and 'output = ""', a message could be written into output - and thereby be lost. Not threadsafe. Besides, I'd consider this sort of a deroute. Why not create an 'output'-class, and pass it to your tests? This output-class (interface) could have various implementations. One that logs to a console, one that logs to a file etc...
  11. stein

    ToyRacers

    Hey! I've just uploaded a beta version of my latest project - ToyRacers. Get it here. I've decided to make the game "donate-ware" :) I hope you like it! Let me know what you think... Enjoy! best regards, Stein Nygård
  12. Ah sry... Don't know where to find such tutorials. Why don't you use GLSL?
  13. http://www.lighthouse3d.com/opengl/glsl/
  14. stein

    kid programming

    Quote:Original post by adam_o I started with HyperCard when I was about 10 years old. Hah, me too! Good times... :D
  15. Looks like you're not binding your shadow-texture anywhere? Could be that you're only binding it when rendering to it, and therefore it works if you don't bind the decal texture at all (assuming you are running avery small testcase here). The problem may also be in your shader-code... Perhaps you could post it too? Also, you don't need to set your filter-parameters more than once for each texture. When you've created your texture, set it once and let it be :)
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!