[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: Weird figures with OpenGL 3.2 and Intel HD3000 Keith Bauer Thu Feb 02 06:09:42 2012

> I was considering using three GL programs, one for the Earth, one for the 
> Moon and the other for satellites, but then I backed off because I had no 
> clue on how to share a shadow map between different programs.

? It's just a texture...

> I never have used #if directives in shader programing. How do you control the 
> value of the preprocessor variable being tested?

The only way is to use #define within the shader text.  However, you
can use the fact that glCompileShader takes multiple strings to easily
put the #defines in string # 0, and the generic shader text in string
# 1.

> Besides, I agree with you this code is not throughly optimized; but then, 
> even if, as you say, it pays a penalty for doing cascaded "if (…)", IMHO, 
> that penalty should at most represent 10, may be 20%. But not that much (and 
> it does not explain why it works great on an NVidia 9400M…).

Why are you pulling numbers out of your hat?

If the hardware works by executing every instruction, regardless of
whether its branch is taken, which wouldn't be entirely unreasonable,
then having unexecuted branches is as expensive as executing both
branches.  If the hardware only executes instructions where at least
one unit in the work group needs the instruction, that's maybe "fine",
though you'll still pay the penalty of calculating that.  Do you know
which way the Intel and the NVIDIA work?

Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]