Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 13 Jun 2001
Online Last Active Today, 10:13 AM

#5158540 Screenspace Shadow Mapping Help!?

Posted by Madhed on 05 June 2014 - 03:35 PM

Found this siggraph crytek paper from last year. http://www.crytek.com/download/Playing%20with%20Real-Time%20Shadows.pdf


They are talking about shadows in general and there is a tiny little section about screen space self shadowing that seems to use this technique.

As a screen space technique it's not a drop-in replacement for regular shadow maps, really just an addon to increase fidelity.


I can imagine it working pretty well for range restricted point lights though.


Are you using deferred lighting? Then it should be a pretty straight forward to incorporate the tracing into the rendering of the point light polygons.

#5158382 [updated]: Make certain objects arrive in the scene (a lorry)

Posted by Madhed on 05 June 2014 - 07:33 AM

so you have a list of trucks that arrive after a specified amount of minutes plus or minus a random amount of minutes. And you want to take the next truck out of this list when the amount of minutes has passed.


Is this correct?

#5157531 Is working in terminal/console really a waste of time?

Posted by Madhed on 02 June 2014 - 07:34 AM

The good thing about coding for the console is that you don't need to include dozens of huge confusing libraries when starting out. You can focus on learning algorithms and data structures.


As Promit pointed out, console programs can be quite useful. Especially when you need some custom tools in your production pipeline.

#5157235 Why do graphic intensive game use a lot of energy

Posted by Madhed on 31 May 2014 - 05:24 PM


Each transistor on a processor consumes power while it's active -- a certain amount while open, less while closed. There's also energy consumed in switching, but even when not in use they are draining some power.


Are you sure about that? I though transistors in a CMOS configuration use negligible energy when in a stable state.



Correct, most power is dissipated during switching. The negligible current while in a stable state is actually the reason CMOS is used.

#5153633 About entity component system design

Posted by Madhed on 14 May 2014 - 01:17 PM

Wait. You're using Unity right? Unity itself already contains an ECS.


Components are subclasses of Unity's MonoBehaviour class.

Entities are instances of Unity's Entity class.


Systems don't really exist in Unity because it uses the kind of entity system where components also contain logic.


To me it seems kind of "wrong" to implement your own ECS on top of that.

#5149830 Screenshot of your biggest success/ tech demo

Posted by Madhed on 27 April 2014 - 05:14 AM

I did some freelance programming on My Dolphin Show. Nothing next-gen though but a fun little game that's getting good reviews and has a few million installs.

Get it! it's free :D







#5149685 Applications vs. Webapps

Posted by Madhed on 26 April 2014 - 12:24 PM

Yep that actually belongs in the con list. Dont know how it ended up there.
As for transpilers. Didn't really think of that. Good point.
Im not against pure JavaScript either. Just thought that might be a negative for people who are used to other languages.

#5149667 Applications vs. Webapps

Posted by Madhed on 26 April 2014 - 10:52 AM

A webapp is just an application that runs in the browser using web technology like html, javascript, xhr, etc.



- user does not need to install the software

- user does not need to update the software

- cross platform

- sandboxed (browser separates app and os)

- rich design language (css)



- requires internet access at all times (except if you do advanced stuff like html5 application cache)

- javascript

- can be slower than a native app

- browser differences can make development difficult

- sandboxed (if the app needs access to "unsafe" os functions you're SOL)

#5142643 Using MakeHuman..is it cheating?

Posted by Madhed on 27 March 2014 - 11:38 AM

IMO using such a tool as a starting point to make your own characters is perfectly fine.

Why should you reinvent the wheel?


When I'm coding I can use thousands of libraries that other people have written and use those with my own written code to put together a finished product.

Why should artists not do the same?

#5142145 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 05:26 PM



There are two ways to use setInterval.


1. Pass function as a reference: setInterval(function() { doSomething(); }, 10);


2. Pass an expression as a string: setInterval("doSomething();", 10);

#5142069 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 01:11 PM

// Creating a function in javascript

//1. directly named
function a() {};

//2. anonymously, assigned to variable
var b = function() {};

//3. via operator new (dont do this)
var c = new Function("arguments...", "body");

//4. anonymously, as a temporary variable (the temp is a reference to the function)
function() {};

OP creates a function when the script executes via method 4. The reference to the function is then passed to the internal setInterval function.

setInterval is internal to Chrome's V8 engine and repeatedly calls the function via reference. No additional functions are created.


If you can show me where my explanation is wrong, I welcome you to do so. If you continue attacking without reason I will assume that you are a troll.

#5142054 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 12:42 PM



In javascript functions without a return statement return the value undefined.

#5142053 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 12:40 PM

what is written to setInterval is  javascript code that gets executed every time the interval passes


What is "written" to setInterval is a reference to the function.


since it is not an r value, it gets also executed-entered


I don't know why you are talking about r-values as this is javascript and not c++.

#5142046 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 12:23 PM

The code is not creating a function every interval. It is passed once as an argument, that is all.

Furthermore your code is not correct. heavy() returns undefined. So you are actually calling setInterval(undefined, 1);



Apart from that typo, both snippets are identical except for the fact that in OP's code the function is anonymous whereas in yours it's stored in the variable heavy.

#5142029 Javascript Memory leak

Posted by Madhed on 25 March 2014 - 11:01 AM

it seems to leak according to chrome dev tools 


Is this the whole code? How did you come to the conclusion that it leaks memory? That simple snippet should not leak any memory.



I just tried it myself. Even with a completely empty interval function the memory usage increases continually until chrome decides it's enough and frees a large block. This is completely normal behaviour and does not mean there is a memory leak. If you let the profiler run long enough you will see some kind of zig-zag pattern where memory usage increases up to a certain point and then suddenly drops. Older browsers used to have problems detecting circular references and thus never freeing some memory but in my experience this is mostly fixed now.


It is nevertheless a good practice to keep memory allocations low so the GC doesn't have to do as much work because it can slow down your application a lot.