• Content count

  • Joined

  • Last visited

Community Reputation

807 Good

About lonesock

  • Rank
    Advanced Member
  1. Quote:Original post by Geometrian Consider that your blur kernel will have to handle edge cases, because the clamp/repeat functionality won't work. That's a whole lot of conditional tests for each fragment . . . Hmm, I'm not sure I understand. As long as the filtering keeps each component (r,g,b,a) separate, I shouldn't face any more issues than I normally would with a single shadow map, right? For cone spotlights, I would probably just mask off a circle around the outside of the depth-mask at 0.0, so the light would not be cast outside its cone. The final shader would have to sample the shadow-map 4 times, retrieving uv[0].r, uv[1].g, etc., but each one should be properly clamped. I'm sorry, I'm sure I missed your meaning. Jonathan
  2. Quote:Original post by MJP You shouldn't need to use blending. Use color write channels to mask off the channels you don't want to write to. Ah, thanks Matt...even easier! Jonathan
  3. Quote:Original post by osmanb If I understand this correctly, you're still going to need to do multiple reads from the texture during the lighting pass, assuming that these are normal (light-space) shadow maps. If they're the screen-space results of shadowing, then yes, you can get multiple shadows in the channels of a single texture. But otherwise, the UVs (computed using the world -> light -> projection matrices) aren't going to match up. Incidentally, even with that caveat, we still did something like this on Marvel Ultimate Alliance 2. We had several shadow maps, with VSM for filtering. The RSX (PS3) doesn't have a two-channel 16-bit format, so we overlaid two shadow maps into a four-channel 16-bit format, and then did the VSM blurring for two shadows at once. Although, our technique was closer to the 2nd thing you described: We rendered each shadow map to a separate Z buffer first, then combined them together during the first pass of VSM. You are correct, the shadow maps are in light-space. What I'm doing right now is storing the projection matrix for each spotlight in a texture matrix. That way, in my vertex shader I compute the varying shadow_map projection vec4 once per shadowmap (using gl_TextureMatrix[i]). In the fragment shader I would have to do a separate fetch for each shadow map sampled, but at least I wouldn't have to bind more textures, and as you say, the blur pass amortizes the cost. There's probably a beter way to do this, however. [8^) BTW, it _looks_ like I'll be able to get basically the same soft-shadow effect with a single texture channel, meaning that I could potentially store 4 shadow maps per texture, thus rendering 4 spotlights' soft-shadows per pass! thanks for the feedback, Jonathan
  4. @Erik: Great idea! Maybe just using the glBlendEquation( GL_MAX ) will do the same thing, without me having to worry about rendering order? Thanks again! EDIT: GAH! I meant GL_MIN. And I'm glad you liked the video. [8^) Jonathan
  5. Hi, All. (EDIT: sorry, brain's asleep...I'm using FBOs under OpenGL, but it would be nice to know if this is doable under DX as well) I'm working on a new (very fast) soft-shadowing technique, and it uses a VSM-style blur on the shadow map as an intermediate step. I was wondering if there is an efficient way to combine multiple shadow maps into one texture, so the blurring pass could be shared, saving time. Ideally my code would go something like this: * Set up texture-1 as a RGBA16f. * Render scene from spotlight-A into texture-1.rg * Render scene from spotlight-B into texture-1.ba * Blur texture-1 (probably 5-tap separable Gaussian) * Render final scene, computing soft shadows from both spotlight-A & -B using only a single fetch from texture-1 Is this possible? I know that I could render spotlight-A's depthmap into texture-1, and spotlight-B's depthmap into texture-2, then combine both texture-1 & -2 into texture-3 before blurring, but that seems a bit of a waste. If there was an efficient way to do this, you could even set up 4 simple depthmaps in one RGBA16f texture for distant spotlights, and render 4 shadowmaps at once (assuming they were far enough away that the non-softness wouldn't be an issue. I really appreciate any help / pointers / advice. thanks, Jonathan (btw, a tiny video showing the current state of the technique is here on YouTube, though I will probably have to change the name before going public [8^)
  6. SOIL: new lightweight image loading lib

    Quote:Original post by velk hi i ve got problem with soil for a 2d opengl engine rendering quality is bad especially when i ve got color gradients on my textures. dont know why, but I m sure that the problem is related to soil options , because when i use my own LoadBitmap code , i dont get this problem http://www.vm-games.com/imgs/in_jpg.jpg http://www.vm-games.com/imgs/in_engine.jpg i cant explain because i m using the same filtering (linear) with both soil code and load bitmap code any ideas? Any chance you could post the code you're using to load the image via SOIL? Is it possible you have DXT compression enabled? Depending on the resolution of the original image and the options you've supplied to SOIL, SOIL may be upsizing the image to a power of two, which could lead to stair-stepping like that over long gradients.
  7. SOIL: new lightweight image loading lib

    Hi, all. As you know, SOIL uses stb_image internally for most if the loading/saving functionality. In recent times Sean updated his stb_image code to be thread-safe. In doing so he apparently made a bunch of changes that are compiler specific. I didn't notice at the time, and I was only distributing a precompiled lib made with MinGW. It used to work on all compilers, but now that stb_image uses compiler specific functions, SOIL now needs to be compiled on each target compiler. SOIL ships with a number of project files: Code::Blocks, a makefile for GCC (Linux and Mac and MSYS folks), Visual Studio 6, 2003, 2005, 2008 (in the VC6, 7.1, 8, 9 directories, respectively). So everybody should be able to build it on their dev machine, in theory. Is this a problem? Should I just have N compiled library files ready to go in the zip? Jonathan
  8. Hi. If you are using GLSL then you do not get to pick the shader model (unlike in the DirectX world, and the GLSL spec requires functionality that really needs SM3 hardware). As you are on a NVidia card, you could run NVemulate and make sure that your advanced hardware features are turned on.
  9. "The Core" iRiff

    Quote:Original post by Crazyfool I dont know what a Riff is and the sample is not working. Basically, we're the annoying guys who talk over the movie. Here are the direct links to the sample, hopefully one of them will work. (The iRiff site just went live, and apparently they're working through some kinks ;-) Google Video Preview YouTube Preview (same thing) (thanks for trying it!)
  10. "The Core" iRiff

    Hey, all! My 1st Lounge post! Mostly an announcement, but not game programming related, so here goes: My friend Tom and I just finished riffing the movie "The Core". The link is here (and there is a short video sample there too). Mike Nelson (the guy on MST3K for the second half) continued on doing RiffTrax (you download a MP3 to play along with a modern movie), and now they have opened their site for fan-made 'iRiffs', and that's where Tom and I come in! Anyway, that's about it, but be sure to check out some of the other iRiffs (and if you've never seen a RiffTrax, ignore my link and go straight to the main page and grab one of the official ones! Hope you enjoy!
  11. OK, I've updated the application, so the 'file="whatever.wav"' works (as shown above, same download link). Please let me know if you have any problems. Share and enjoy!
  12. @fruki: Thanks! Glad you had fun! @Halifax2: Thanks! I do want to make a commercial version, but I also want the free version to be of use to hobby game programmers, so I'm just trying to find the balance between feature sets of the free and paid versions. For the full version I was planning on a more flexible output scheme (custom hashing of the strings, custom multi-level directory hierarchy, etc.) If you would be OK with an optional filename specification per line of dialog, something like: <line txt="shameless plug for lonesock" file="blatant\goodness.wav"/> I'd be happy to put that in the free version. Would that work for you? BTW, you mentioned some uses apart from game resources...what other applications do you have in mind? Thanks for the feedback, everybody!
  13. VSM Extended - Take 2

    Hey, bzztbomb, nice quick screen-shot overview! Regarding my previous goals, here's an update: * no beter alternate encoding, other than storing 1-depth helps 16f formats * calculating sigma in the blur pass: haven't had time yet * hardening the shadows doesn't look good with my Mipmap-then-3x3-Gaussian-Blur method...maybe using a regular separable blur with a larger kernel would look good. * The Intel G43 supports GLSL 1.10 pretty well (need the latest drivers), but does not allow the *Lod version of the texture fetch commands inside the fragment shader. That's OK if you don't want the fake PCSS (which depends on specifying the mip level specifically). * OBJ loading still needs an update, lack of time again. Thanks again for your patience everybody!
  14. Hi, all. I'm making a tool for my game, and I hope that others might find it useful. Given an XML input file of lines of dialog, it generates WAV files to be used as placeholder dialog until you hire actors to record the final dialog. (or, like me if you need a game full of robotic-sounding voices, you can just leave the output as is [8^) Here is the download link. The application is a 3.5MB console app for Windows (compressed with UPX), including a statically-linked voice (using the Flite text-to-speech engine). Hopefully all the info you need to run it is in the included readme file. I'm planning on making a commercial tool out of this, so I would really appreciate your feedback on this free version! The commercial version is planned to have souped-up abilities, including: * SAPI 4 & 5 interface, for using multiple voices / languages * GUI * multiple hashing functions for the output file naming convention * MP3 and OGG encoder option Here is the sample XML input file included in the zip: <phvoice> <settings> <out_dir>C:\game-voice-dir</out_dir> </settings> <actor name="Ford"> <line txt="Looks like a fish, moves like a fish, steers like a cow."/> <line txt="Time is an illusion. Lunchtime doubly so."/> <line txt="You're a load of useless bloody loonies!"/> </actor> <actor name="Arthur"> <line txt="Charming man. I wish I had a daughter so I could forbid her to marry one."/> <line txt="Ah, this is obviously some strange usage of the word 'safe' that I wasn't previously aware of."/> </actor> </phvoice> enjoy!
  15. VSM Extended - Take 2

    Thanks, Matt and Wolf! Yep, I will release a demo soon. Things I'm working on: * I think I have a better alternate encoding for low precision formats. * For cases where the shadow texture size is smaller than the screen size, I plan to perform the calculation of sigma (taking the square-root of variance) inside the blur shader, and store average depth in one channel, and sigma directly in another (instead of average depth^2). * I'm working on an option to harden the shadow edges artificially, but not be blocky (should be straightforward to do...by cranking up the fall-off term from 1.333 to something much higher I should be able to get an effect similar to the signed distance field alpha-threshold effect) * I now also have access to an Intel G43 chipset, which supports GLSL 1.10 with the latest version of the drivers. I'm trying to get this to work there (I can not use any of the *Lod version of the texture fetch commands, so I need to determine which mipmap level is accessed by default, so I can duplicate the *Lod calls with the mipmap bias term from the regular texture fetch versions) * I will probably update my OBJ loader...I have some bugs in there, especially with normal vectors! Thanks for your patience.