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 05 Oct 2005
Offline Last Active Yesterday, 04:39 PM

#5235225 Uses of curves in graphics?

Posted by Sirisian on 16 June 2015 - 07:39 PM

I've always found the CSS documentation on MDN to be a nice overview of timing functions: https://developer.mozilla.org/en-US/docs/Web/CSS/timing-function


Also check this out: http://www.gdcvault.com/play/1020583/Animation-Bootcamp-An-Indie-Approach (It starts at movement continued with a full animation system defined by curves)

#5225744 Direct3D 12 documentation is now public

Posted by Sirisian on 26 April 2015 - 08:17 PM


Okay almost have DirectWrite working and Direct2D. All the code is done from what I can tell. One big issue though and I fear this is a critical bug still. You can't get a IDXGIDevice from a ID3D12Device?

Microsoft::WRL::ComPtr<ID3D12Device> mDevice;
hr = D3D12CreateDevice(.., D3D_DRIVER_TYPE_UNKNOWN, D3D12_CREATE_DEVICE_NONE, D3D_FEATURE_LEVEL_11_1, D3D12_SDK_VERSION, __uuidof(ID3D12Device), (void**)&mDevice);
Microsoft::WRL::ComPtr<IDXGIDevice2> dxgiDevice;
hr = mDevice.As(&dxgiDevice); // E_NOINTERFACE No such interface supported.

As you may know the alternative code, shown in the documentaiton, when not using ComPtr is:

hr = mDevice->QueryInterface(__uuidof(IDXGIDevice2), (void**)&dxgiDevice); // E_NOINTERFACE No such interface supported.

This produces the same error with IDXGIDevice, IDXGIDevice1, IDXGIDevice2, or IDXGIDevice3.


Since getting a valid IDXGIDevice is required to create a ID2D1Device1 - using the ID2D1Factory2 - it's impossible to use DirectWrite easily with D3D12 as far as I can see. Is there something simple I'm missing? Did something change with how you go from D3D12Device to IDXGIDevice2?


Yes, IDXGIDevice interfaces are no longer supported with Direct3D 12 (that's not a big secret as you found out about it!).


If you look in the SDK you will find an header (and its .IDL) called "d3d11on12" and if you open it you will find what this new API is meant about: interoop between Direct3D 12 and Direct3D 11 (also not another big secret since it states in the API comments).


Darn. Yeah I commented about that the other day. Got the impression that d3d11on12 was the only way, but noticed the only missing piece was the IDXGIDevice. Seemed weird to have to use a whole separate API as a workaround. I have it partly coded though. Thanks for the clarification.


Actually not too bad. Just needed this I think:

const const D3D_FEATURE_LEVEL featureLevels[] = { D3D_FEATURE_LEVEL_11_1 };
IUnknown* commandQueues[] = { mCommandQueue.Get() };
Microsoft::WRL::ComPtr<ID3D11Device> mD3D11Device;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> mD3D11DeviceContext;
hr = D3D11On12CreateDevice(mDevice.Get(), D3D11_CREATE_DEVICE_SINGLETHREADED | D3D11_CREATE_DEVICE_BGRA_SUPPORT, featureLevels, ARRAYSIZE(featureLevels), commandQueues, 1, 1, mD3D11Device.GetAddressOf(), mD3D11DeviceContext.GetAddressOf(), nullptr);

This returns S_OK.


It works! Then also you need to do:

Microsoft::WRL::ComPtr<IDXGIDevice> dxgiDevice;
hr = mD3D11Device.As(&dxgiDevice); // S_OK

Microsoft::WRL::ComPtr<ID2D1Device1> mD2DDevice;
hr = mD2DFactory->CreateDevice(dxgiDevice.Get(), mD2DDevice.GetAddressOf()); // S_OK

I'll have a full example when I'm done understanding and learning. I don't want to give out bad code examples since I've never really used D3D before this point.

#5219225 What are your opinions on DX12/Vulkan/Mantle?

Posted by Sirisian on 25 March 2015 - 10:13 PM

Just saw this was posted: https://msdn.microsoft.com/en-us/library/windows/desktop/dn903821%28v=vs.85%29.aspx Seems to be the D3D12 Documentation.

#5178225 GOTO, why are you adverse to using it

Posted by Sirisian on 04 September 2014 - 10:39 PM

I have no aversion. The way I write code means a goto is never necessary. I've never ran into a problem and thought to myself that a goto would be cleanest solution in C#, Javascript or C++. Maybe it's useful outside of those languages. I remember seeing it used in C and that's it. I use lambdas a lot and lambda callbacks rather than returns. It's very flexible especially with asynchronous stuff.

#5175408 GUI Scissor

Posted by Sirisian on 21 August 2014 - 10:24 PM

Assuming you only need rectangles you can just passing in the x, y, width, height region as a uniform to your pixel shader and discarding pixels outside the region.

#5174340 Thesis idea: offline collision detection

Posted by Sirisian on 17 August 2014 - 06:38 PM

Even if your memory requirements were enormous for 3D this might still be an interesting experiment to open the discussion to other methods. In 2D this might be feasible. You can precompute the minkowski sum for each object for every rotation to simplify things down to a point vs the world simulation. If you could interpolate the stored state between different rotations you might end up with a very fast solution. There is already research for dynamic minkowski summations. Sounds like this would take a lot of research though and a lot of memory.

#5170496 College or Solo?

Posted by Sirisian on 30 July 2014 - 09:33 PM

For profit schools are generally a sham. You should be looking at and applying to an accredited university for a CS program. You should be programming by yourself already and when you're getting your degree be programming on the side to build experience. The idea is a well rounded education. Try to get scholarships also if you haven't already.

#5151358 Screenshot of your biggest success/ tech demo

Posted by Sirisian on 04 May 2014 - 12:35 AM

I wrote this a long time ago as a tech demo. A progressive voxel raycaster. (Chrome/Firefox). (Image) It can be written faster, but I always like the effects it gives when rendering using the NASA terrain maps. One day I'll go back and implement lighting for it.

#5122533 Weird (But Simple?) Angle Math

Posted by Sirisian on 10 January 2014 - 12:35 AM

Bzroom actually corrected me on this a month ago. I was using the dot product, but you can simplify some things with the cross product. Core code:

function Update()
	var rotationRate = 5 * Math.PI / 180;

	var direction = mousePosition.Subtract(playerPosition).Normalize();
	// Cross product of playerDirection with direction
	var angleError = Math.asin(Vector.Cross(playerDirection, direction));
	// Clamp(angleError, -rotationRate, rotationRate)
	if (angleError < -rotationRate) angleError = -rotationRate;
	if (angleError > rotationRate) angleError = rotationRate;
	// Rotate by angleError
	var temp = Vector.Create();
	temp.X = Math.cos(angleError) * playerDirection.X - Math.sin(angleError) * playerDirection.Y;
	temp.Y = Math.cos(angleError) * playerDirection.Y + Math.sin(angleError) * playerDirection.X;
	playerDirection.X = temp.X;
	playerDirection.Y = temp.Y;

Javascript demo. (Right click to view source). Should give you the basic idea.

#5113455 How I can reserve an ideea just for me?

Posted by Sirisian on 01 December 2013 - 05:42 AM

Impossible to do. Game concepts can't be patented generally. Your best bet is copyright and trade secrets. That is when you create your characters and world your art and characters will be copyrighted. Trade secrets in this case means don't tell anyone until you release it. After you release it others can copy your gameplay and mechanics as much as they want. It's important if you do something unique to do it the best.

#5113423 Good old multi account problem

Posted by Sirisian on 01 December 2013 - 12:11 AM

Design your game such that multiple accounts offers no benefit? That's really the only way.

#5093502 I would like to officially declare omnidirectional shadow maps as being pract...

Posted by Sirisian on 12 September 2013 - 01:54 AM

You bumped a thread from 2005. That said nowadays you'd just use rectilinear texture warping. Does a similar trick I'd imagine to his code. That is using a low resolution texture and stretching the scene to apply finer detail in certain areas. Could use the technique with a dual paraboloid method. (No need to use a cubemap).

#5076423 RPG Shadows, CSM, TSM, what else?

Posted by Sirisian on 09 July 2013 - 03:17 PM

You can probably use RTW. It's one of the best shadow mapping algorithms.

#5006678 Expensive Post Processing Techniques

Posted by Sirisian on 03 December 2012 - 11:07 AM

If you had a model renderered and a very basic g buffer you could analyze ssao. The many naive approaches are expensive with tons of optimization routes to research.

#4999078 Opinions on my multiplay solution

Posted by Sirisian on 08 November 2012 - 06:33 PM

Just know that 60 updates per second is a lot. Not sure if this is for the Internet, but with TCP you might see stuttering so you might want to lower that down to 10 to 20 in the future depending on your requirements.