• Create Account

# JohnnyCode

Member Since 10 Mar 2008
Offline Last Active Yesterday, 08:51 AM

### In Topic: Visualize points as spheres

Yesterday, 08:45 AM

But billboards would introduce scaling artefact in shadowmap, considering they can be bigger/smaller. A larger bilboard texture sampled is a serious underperforming.

A 64 vertex mesh being rasterized over several pixels without any texture sampling is simply the fastest thing that can happen, plus, it is a well defined sphere (a mesh).

### In Topic: A quick way to determine if 8 small integers are all equal to each other

Yesterday, 08:33 AM

bool EightNumbersEqual(a,b,c,d,e,f,g,h)

{

return (a^b|a^c|a^d|a^e|a^f|a^g|a^h)==0 ? true : false;

}

Guys, I strongly believe this one works, but my question is... would this be any faster/slower than a single integer number multiplication?

### In Topic: A quick way to determine if 8 small integers are all equal to each other

24 October 2016 - 10:48 AM

Yep, so true!

### In Topic: A quick way to determine if 8 small integers are all equal to each other

24 October 2016 - 10:12 AM

Given eight integers, what is the fastest way to check if they are all the same or not? Maybe, some clever bit manipulation?

Following appeals to me.

bool EightNumbersEqual(a,b,c,d,e,f,g,h)

{

return (a|b|c|d|e|f|g|h)==a ? true : false;

}

You can expand it to unknown amount of checked numbers, and I believe it will work for any numerical type since of the bits->number determinism.

### In Topic: How to separately discard in multiple rendering targets fragment?

17 October 2016 - 05:06 PM

In MRT (multiple render target) discard in pixel function will prevent entire pixel function from altering output (depth buffer, everything), whether it is implemented with some separating options- might be in some super high OpenGl but I'm sceptical, since you can trivialy solve this problem by enabling Alpha Mask state and alter the fourth component of color you are outputing accorindgly (zero or masked value in first one, 1.0 in second opaque one).

PARTNERS