Jump to content

  • Log In with Google      Sign In   
  • Create Account


Triad_prague

Member Since 06 Apr 2010
Offline Last Active Dec 09 2013 07:13 PM

#4901974 implementing skybox in a chunked scene/level

Posted by Triad_prague on 12 January 2012 - 06:30 AM

Hello, IMO you don't need to display a *HUGE* skybox just to show the sky. I only draw a 10 unit size cube with proper texture on it. The cube is drawn first, the faces are facing inside, and I disable depth testing and depth writes when drawing it. Then I turn depth testing and depth writes back on and draw other objects in the scene. It creates illusion of *LARGE* box encompassing all objects in the scene.


#4899168 How/when do compilers do syntax checking?

Posted by Triad_prague on 02 January 2012 - 09:29 PM

Hi, I've finished a small scripting language resembling a C-language. I named it clsl (stands for C-Like Scripting Language). I miss one critical implementation though .... and that's the syntax checker!!

So I'm asking you guys, since I really know nowhere else to look. How do compilers perform syntax checking? when do they do it? Do they:
-check syntax of all source files, then only proceeds to compile if there's no coding typo/typing error
or do they:
-compile the source, catch error along the way, and then decide whether to continue/stop the compilation.
Right now, this is what I'm using. The compiler compiles all source, and abort the process once it encounters any error (and also write the error to log file). Thing is, I think there are way too much error cases to catch, and thus this approach is kinda ugly and of course there are MANY times where my script compiler just crash and doesn't report anything (a non-reproducible bug/flaw). Do you have a suggestion of how to write a good syntax checker? thanks btw Posted Image


#4892042 Is any recursive function can be translated into its iterative form?

Posted by Triad_prague on 08 December 2011 - 08:44 PM

Whoa, thanks for your suggestions!! it supports recursion now, basically for each script function I store:
-information about its local data(local variables and function parameters), how many local vars, how many bytes needed for those local vars.
-its instructions....
-its return type

then when the script calls a function, it will:
-allocate bytes needed for the function's local data + request storage for return value
-point the function to the allocated bytes
-'push' to the call stack (make it the current function)
-execute its instructions

upon returning, it will:
-store any return value it has to store
-release all data it has
-restore call stack or 'pop'

and it worked nicely, I've tested it by making a factorial function inside the script.....now I only need to 'FIX' the stack size (I want to allocate some bytes at the beginning that acts as a stack 'pool', but that's not hard to do)

many many thanks guys !! :lol:


#4891009 Does the old SNES RPG game load all map at once?

Posted by Triad_prague on 06 December 2011 - 01:41 AM

whoa, thank you guys for the fast response!

BTW I'm trying to get the same effect with my framework here, thing is....I only load map on demand (when the player collides with a trigger, and that trigger call change_map() ). How am I going to do that? I can pre-load all maps but that might consume enormous amount of memory. So if you got any ideas, please share here....thanks!! :D


#4889304 Detecting allocated bytes using a void pointer

Posted by Triad_prague on 30 November 2011 - 10:19 PM

Thx SiCrane, Hodgman....that cleared my doubts. Hmm I guess I'll just keep a list of allocated size rather than complicating myself with those hacks. Once again, thanks!!!:lol:


#4879080 basic voxel terrain rendering

Posted by Triad_prague on 31 October 2011 - 07:07 PM

FleBlanc, PolyVox, +1 for y'all. I'd start getting those resources to read, and I hope I can come up with something...once again thanks :D


#4874992 Gamma correction in OpenGL

Posted by Triad_prague on 21 October 2011 - 04:10 AM

Do it in your last screen-space shader or add one for that purpose. Just before presenting the image to the user.


duh, I don't use shaders atm. and the games I've played (that supports gamma correction) don't use shaders too (it's old games).


#4874986 Gamma correction in OpenGL

Posted by Triad_prague on 21 October 2011 - 03:20 AM

I just realized that some games provide the user with the capability to set the "brightness" or gamma correction (CMIIW). I want to implement it but I wonder how would I go for it in OpenGL? Do you know if such a way exist? Thanks before :lol:


PARTNERS