Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

101 Neutral

About Muncher

  • Rank
  1. I was reading John Carmacks old blogs: http://www.armadilloaerospace.com/n.x/johnc/Recent%20Updates when i got to the section about derivative instructions in pixel shaders. Firstly, whats a derivative.. and second, whats a derivative? Thanks for any help...
  2. Muncher

    dependant texture reads...

    ok that makes sense, thanks (rating++) Just off topic (and i apologise) On new hardware (gf6/7 etc) - the number of textures we can sample in a pixel shader is limited the the number of texture units right? So my geforce 7800 can access 4 textures per program (num texture units is 4)... But while looking up dependant texture reads, i came across an article that stated "its possible to access up to 8 different textures (in a fragment program), but only a limited number of dependant texture fetches can be performed..." Does this mean that we can access more textures in a shader if they are not read dependently?
  3. What is a dependant texture read (in a pixel shader) ? I can't find a definition anywhere :) Cheers Paul
  4. Muncher

    packing a float into a vector

    well, the output in the shader is clamped to 1.0 (i think) - am i right in thinking that x stores the fractional part y stores the first byte z the second byte so shouldnt floor(dist)/256.0f actually be /255.0f if it's to be in the 0-1 range? and the 65516.0f should be 65535.0f - or have i missed something?
  5. Can someone please help me understand the following Cg fragment shader code: I think what this shader is packing a floating point number into a 3 compoment vector; what i'm not sure about is how its doing this. float4 main(fpin IN) : COLOR0 { // Distance to the light squared float dist = dot(IN.LightVec, IN.LightVec); float temp = floor(dist)/256.0f; float temp2 = floor(dist-256)/65516.0f; return float4(frac(dist),temp, temp2,1.0); }
  6. Muncher

    DLL question

    Cheers, thanks for the answer :) I'm a little confused by "process" in this sense. When an application loads a DLL, it loads maps the module into its own address space; But what is happening if a Application loads a DLL, that also loads a DLL eg: App -(loads)--> DLL1 -(loads)--> DLL2 Does DLL2 become mapped to the application address space? What if the application also directly loads DLL2 with LoadLibrary (so DLL1 loads DLL2, AND The application loads DLL2) does this return the same handle as when DLL1 loads DLL2?? sorry, this went abit off topic
  7. Muncher

    DLL question

    I have created a dll, and would like multiple processes to load it; is there a way to count how many processes/applications have loaded a particular DLL (internally to the DLL) ? Or does each process need to load a unique copy of the DLL? Cheers :)
  8. Muncher

    spash screens

    I love those beautiful splash / loading screens that pop up when the application is launched! An example would be the Nero / Photoshop, even the visual studio splash screen. How do you do them (C++)? Or rather, what is the technique that most commercial packages use? Is it just a frameless/borderless (WM_POPUP) window thats created with a CreateWindow() call? If so, how does the photoshop window appear to have its image appear to extend beyond the window bounds? It looks as if there is some transparent / alpha stuff going on there. Ideally there would be a Win32 API call: ShowSplashScreen(char *bitmapFilename), but we can only dream :)
  9. Muncher

    What is the compiler doing?

    The following lines set up the C library: call __alloca call ___main so thats helping me understand what linking with the C runtime is doing and how its initialized :) The line: andl $-16, %esp aligns the stack with the next lowest 16-byte boundary, so you guys were right. I still don't fully understand what that means, and what the implications are (i assume its a performance thing) If anyone knows of an example, or can explain this feel free :) BTW, i just found a really cool link that explans the GCC asm for a simple c program line by line, its here
  10. Muncher

    What is the compiler doing?

    Here is the compile of the _main function with basic optimizations, -O and your right, alot of weird code hasbeen removed. _main: pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $16, %eax call __alloca call ___main movl $100, %eax leave ret I'm not sure whats hapening with the andl %-16, %esp - What is aligning to the stack boundary? And why is the code doing that? Has that got something to do with the call to __alloca? Thanks for the replys so far :)
  11. I decided to finally take a look at the ASM output from a basic C program to figure out what the compiler is doing. For the most part, i understand whats going on, but there are a couple of statements that don't appear to make much sense. Here is the original C program int myFunction(void) { int herro = 69; return herro; } int main() { int x = 100; return x; } This compiles to: .file "hello.cc" .text .align 2 .globl __Z10myFunctionv .def __Z10myFunctionv; .scl 2; .type 32; .endef __Z10myFunctionv: pushl %ebp movl %esp, %ebp subl $4, %esp movl $69, -4(%ebp) movl -4(%ebp), %eax leave ret .def ___main; .scl 2; .type 32; .endef .align 2 .globl _main .def _main; .scl 2; .type 32; .endef _main: pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $0, %eax addl $15, %eax addl $15, %eax shrl $4, %eax sall $4, %eax movl %eax, -8(%ebp) movl -8(%ebp), %eax call __alloca call ___main movl $100, -4(%ebp) movl -4(%ebp), %eax leave ret I understand the __Z10myFunctionv: function, but what's confusing me, is the following lines: andl $-16, %esp ; Why are we and'ing the stack pointer with -16? movl $0, %eax ; why is the compiler moving 0 into the eax reg, then adding addl $15, %eax ; 15 to it twice? addl $15, %eax shrl $4, %eax ; <-- ?? Cheers for any assistance. Note: this was compiled with gcc in Windows XP: gcc hello.cc -S
  12. Muncher

    building makefiles in windows

    ahh cheers mate! looks like MinGW is the way to go :)
  13. Hi, I'm coming across alot of projects that are distributed with a makefile, but no vcproj file. Im only used to working in windows, but how can i build these projects? Is there some way to convert a makefile to a vcproj file?
  14. Muncher

    is open source viable for a company

    My understading of OC software is rather limited; but if you sold OC software, are you also selling the content? Is that what you mean by customization services? If i sold software that compliled to a single executable, then going open source would be a bad idea. But if that executable required additional content to run your program (ie/ model files, bitmaps, sound files) then these remain your property.. so it's not all that bad?
  15. Hello, this could be a really silly thought, so beware :) But is making all of your source for a commercial project (game, or related field) completely open source with a GNU license good idea. I can see lots of benefits, especially in being able to use other open source code within your project, saving time for developing in house. You can still sell your product, as all of the content is copyrighted and needs to be purchased; i guess one of the problems is if alot of your IP is the code itself... Are any commercial companies taking this approach? It would be great if everyone did it :) Muncher
  • 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!