Jump to content

  • Log In with Google      Sign In   
  • Create Account

unbird

Member Since 04 Jan 2010
Offline Last Active Private

Posts I've Made

In Topic: Erasing Character

Yesterday, 04:49 PM

Precisely, you have been told already.

In Topic: D3D11 - Pretransformed vertices? (GUI)

24 June 2016 - 08:09 AM

Yup, changing the viewport needs adjusted transformations, as Hodgman shows.

 

You could use scissors (ID3D11DeviceContext::RSSetScissorRects) for axis aligned clipping and keep the viewport as is. Probably the simplest to implement.

 

For completeness: There are other ways to clip:

- Look into SV_ClipDistance semantic (VS output)

- Similarily: Manually clip in the pixel shader with clip/discard

- For rectangles you could "clip" in the vertex shader (rect intersection calculation, adjusting tex coords, too) (*)

- Hint: SV_Position as input to the pixel shader delivers pixel coordinates (with a 0.5 offset), this can come in handy.

 

Edit: (*) Can be even a good idea to do this CPU-side. Instead of lots of pipeline state changes, one can batch everything.


In Topic: Question about HLSL matrix multiplication

09 June 2016 - 10:17 AM

Because that is not a matrix multiplication but a component-wise one (aka modulate). This is:
 
matrix vp = mul(gProjMatrix, gViewMatrix);

Edit: When you can then use a sequence of matrix-vector mults instead of matrix-matrix. E.g. in this case the instruction count difference is quite big (10 vs. 22).

(Even better: Provide the product with the constant buffer already :wink: )

In Topic: When you realize how dumb a bug is...

18 May 2016 - 05:45 PM

The picture below supposed to be a voxelized sphere.

 

Problem: operator << has lower precedence than +. Should have used | or brackets.

 

Now I feel really dumb. :wacko:


In Topic: HLSL Tools for Visual Studio

25 April 2016 - 10:36 PM

This is great. Thanks alot. :D


PARTNERS