• Create Account

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

cdoubleplusgood

Member Since 11 Jan 2013
Offline Last Active Feb 16 2015 03:36 AM

Setting shader constants: Purpose of various functions

11 October 2013 - 02:43 AM

Hi Folks,

I have 2 questions regarding the various shader constant functions in IDirect3D9Device, e.g. SetVertexShaderConstantB/F/I.

1. Is my assumption correct that both SetVertexShaderConstantF and SetVertexShaderConstantI simply stuff a multiple of 128 bit into one or more constant registers, and there is not actual difference between them? That means, if I had a float[4] and cast a pointer to them to int*, I could use SetVertexShaderConstantI instead of SetVertexShaderConstantF with the same result. (No, I'm not actually going to do this; I just try to understand what goes on behind the scenes.)

2. What does SetVertexShaderConstantB do? How many bits in the constant register are taken for one BOOL? Both SetVertexShaderConstantF and SetVertexShaderConstantI take 4 values or a multiple of them; why is this different for SetVertexShaderConstantB?

Thanks!

Check if point in space is completely enclosed by faces

30 September 2013 - 04:59 AM

Hi,

I want to check if a certain point or box in space (3D) is completely surrounded by faces (e.g. rectangles), so that this point or box is not visible from any location with a certain minimum distance.

Do you know of such an algorithm?

To make it clearer:

Imagine a minecraft style game. There may be caves in the underground, but when you're outside the cave, and the cave does not have any entrance, anything in the cave cannot be seen, from no direction. I want to detect if something is inside such a "cave", so it doesn't need to be rendered (unless you drill a hole and enter the cave).

Thanks,

c++good

Matrix implementation: Searching for older post

23 July 2013 - 02:35 AM

Hi folks,

Some time ago, maybe last year, I read a post here at gamedev containing a very cool matrix implemenation in C++ (or a link to that implementation). The cool stuff was accessing both row and column vectors without changing the "simple" memory layout (e.g. a 4x4 matrix needed only 16 * sizeof(float)). IIRC it used function pointers or functors internally.

There was a lengthy discussion with some guys trying to be smarter... but their proposals required additional data members.

My problem: I can't find that post or thread anymore. If your memory or searching skills are better than mine... can you give me a hint?

Thanks,

cdoubleplusgood

PARTNERS