0. Requirements


 Sample code named 'D3D12HelloTriangle' which was downloaded in lecture 1. (Link)


1. Intro


   In the file 'D3D12HelloTriangle.cpp', we can find many functions. Among them, following four functions form a basic framework: 


- Oninit(): initialize the directx12 rendering environment. 

- OnUpdate(): update frame-based values such as animation matrix. 

- OnRender(): render the scene.

- OnDestroy(): release resources.


 Let's look at the components one by one. 



2. Oninit function


  Oninitfunction contains two additional sub-functions. LoadPipeline() and LoadAssets(). Let's take a closer look at the Loadpipeline() function. 


1) Loadpipeline()

1-1) Enabling the debug layer

  First, the code enables the debug layer by using Microsoft::WRL::ComPtr. 


1-2) CreateFactory

  Next, create a DXGI factory. It is an object that is capable of creating other DXGI objects. 


1-3) CreateDevice

  Then, DXGI device is created. To create device, adapter, and feature level is required. In the sample code, two types of adapter (warpAdapter and hardwareAdapter) and feature level 11 are used. 


1-4) Command Queue

  Command queue is the ordering of the commands. In the D3D11, both the immediate context and deferred context are supported. However, the immediate context is no longer supported by D3D12,  In the concept of deferred context, commands are queued up and run at a later time. For example, in multi-thread application, each threads can generate commands in parallel, and the commands are mounted on an API object called 'Command Queue'. We call it as a command parallelism. 


  Let's take a closer look at command queues and command lists. In D3D12, the process of transferring commands differes from D3D11 in three important ways: (For more details, you can visit the page: (Link) https://msdn.microsoft.com/en-us/library/windows/desktop/dn899114(v=vs.85).aspx


 1. Elimination of the immediate context. This enables multi-threading. 

 2. Apps own how rendering calls are grouped into GPU work items. This enables re-use.

 3. Apps explicitly control when work is transferred to the GPU. This enables item 1 and 2. 


   As mentioned above, D3D12 no longer supports immediate context. Instead, to render, command lists are used. A command list looks similar to the immediate context which is used in D3D11. Actually, they are similar. They contains commands such as drawing primitives or changing rendering state. However, command lists can be recorded to command queue concurrently, which takes advantage of multi-core processors. If the same process repeats over and over, a command list can be executed multiple times. 






저작자 표시
신고

0. Requirements

 

- Windows 10 (please keep your windows up to date.)

- Visual studio 2017 with the windows 10 creator update SDK  (previous version also maybe programmable, but 2017 is recommended.)


1. Intro


 The simplest way to learn new language is to run sample code. Therefore, let's download dx12 sample code from git. Following link allows to download many samples.


https://github.com/Microsoft/DirectX-Graphics-Samples


2. Run sample


  Now, let's run the sample code. In this posting, we are going to execute 'D3D12HelloTriangle'. Let's open it. The code sample is placed in the following URL.


  \anydirectoryyouwant\Directx12\Samples\Desktop\D3D12HelloWorld\src


Then, you can find the 'D3D12HelloWorld.sin'. Open it. There are several sample projects.  Now, please follow the instructions:


1) Click the mouse right button on the project named 'D3D12HelloTriangle' and select the 'Set as startup project'. 

2) Press the F5 button *^^*! (If it does not work, please follow further instructions)

3) If you have problems, maybe some requirements are missed or properties are set wrong. check followings

  3-1)  Does your operating system (windows 10) provides the latest windows SDK version? (The latest version on 2017.04.13 is  10.0.15063.0.) You can identify it from  Right click on Projects->property->Configuration Properties->General->Windows SDK Version. (You can change the SDK version by clicking its panel.)

  3-2)  Does your project use right platform toolset? You can identify it from  Projects->property->Configuration Properties->General->Platform Toolset.  You can use v120 for Visual studio 2015 and v141 for Visual studio 2017. 


 

*Include directory and library is already set in a right way because it is a sample code. So, you may not need to configure those things. 

 *If any problem occur, please leave reply. 


저작자 표시
신고

It is a critical mistake we've done easily that we assume that we already know what people think.   

-> It is a critical mistake (we can easily make/we tend to make/we are prone to make) to assume that we already know what people think.

-> To assume that we already know what people think is a critical mistake we are prone to make. 


Making brief time to write sincere words once a week will bring you something meaningful.

->  


Most people do not appreciate/acknowledge that Washington was a wise military leader.  

-> Washington is usually not acknowledged as a wise military leader.  


Losing moisture from excretion and evaporation must be continuously replaced.

-> Moisture organisms lose through excretion and evaporation must be continuously replaced. 


What makes us real human? 

-> What makes us really/truly human?


More similar point is that two subway systems cover the wide area with cheap fee for commuters.

->  More similar point is that two subway systems cover wide area at a cheap fee for commuters.

-> A further similarity is that two subway systems cover wide area at a low cost for commuters.

  

저작자 표시
신고

Step 1. Define


 CB_BANDWIDTH*        pcbBandwidth = NULL; //CB_BANDWIDTH is a structure for transmitting. 

        ID3D11Buffer*                                     bandwidthBuffer = NULL;

ID3D11ShaderResourceView*       bandwidthBuffer_RV = NULL;


Step 2. Set buffer and its shader resource view

  

        D3D11_BUFFER_DESC Desc2;

Desc2.Usage = D3D11_USAGE_DYNAMIC;

Desc2.BindFlags = D3D11_BIND_SHADER_RESOURCE;

Desc2.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;

Desc2.MiscFlags = 0;

Desc2.ByteWidth = sizeof(CB_BANDWIDTH);

V_RETURN(pd3dDevice->CreateBuffer(&Desc2, NULL, &bandwidthBuffer));

D3D11_SHADER_RESOURCE_VIEW_DESC rd; //never replace this thing into NULL. 

ZeroMemory(&rd, sizeof(rd));

rd.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;

rd.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;

rd.Buffer.FirstElement = 0;

rd.Buffer.NumElements = 7;

pd3dDevice->CreateShaderResourceView(bandwidthBuffer, &rd, &bandwidthBuffer_RV);


Step 3. Fill the data


//Set constant buffer

D3D11_MAPPED_SUBRESOURCE MappedResource;

pd3dImmediateContext->Map(bandwidthBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource);

  pcbBandwidth = (CB_BANDWIDTH*)MappedResource.pData; //CB_BANDWIDTH is a structure for transmitting. 

  pcbBandwidth.data = somedata;


Step 4. Set shader resource and unmap


  pd3dImmediateContext->PSSetShaderResources(77, 1, &bandwidthBuffer_RV); // 77 is a register number. you can set in the shader. 

               // In this example, tbuffer is set to only for pixel shader, 

  pd3dImmediateContext->Unmap(bandwidthBuffer, 0);                       


Step 5. Define the CB_BANDWIDTH in the hlsl shader code with 77 register. 


tbuffer CB_BANDWIDTH : register(t77)

{

Bandwidth bandwidth; //must be synchronized with definition in the cpp code. 

};



Note that, the detailed description of CB_BANDWIDTH and Bandwidth structure is omitted. They can be replaced by simply float4.  

저작자 표시
신고

This posting introduces various methods for measuring stochastic similarity between two groups A and B. 


1. Goodness-of-fit

 

   Goodness-of-fit is widely used to test whether two samples have identical (or similar) distribution. The goodness-of-fit of a statistical model describes how well it fits a set of observations. Measures of goodness-of-fit summarize the discrepancy between observed values and the values expected under the model in question. A goodness-of-fit statistic tests the following hypothesis:


   H_0: the model M_0 fits

   H_A: the model M_0 does not fit(or, some other model M_A fits)


We call H_0 as a null hypothesis and H_A as a alternative hypothesis. 


  In assessing, there are two cases :


1. when the distribution of sample B is known, and

2. when the distribution of sample B is unknown. 


At first, let's assume that group B has known distribution, Gaussian(normal) distribution. 


1-1. Normality Test


 In statistics, normality tests are used to determine if a data set is well-modeled by a normal distribution and to compute how likely it is for a random variable underlying the data set to be normally distributed. For this, following tests are available.


- D'agostin's K-squared test

- Jarque-Bera test

- Anderson-Darling test

- Cramer-von Mises criterion

- Lilliefors test

- Kolmogorov-Smirnov test

- Shapiro-Wilk test

- Pearson's chi-squared test

  

In [Razali et.al. 2011: "Power comparisons of Shapiro–Wilk, Kolmogorov–Smirnov, Lilliefors and Anderson–Darling tests"], Shapiro-Wilk has the best power for a given significance, followed closely by Anderson-Darling when comparing the Shapiro-Wilk, Kolmogorov-Smirnov, Lilliefors, and Anderson-Darling tests. Therefore, we will check those four tests. 





Shafiro test


Anderson-darling test




ANOVA?


Null hypothesis?


K-test?


Difference between One-way ANOVA & Two-way ANOVA


One-Way ANOVA: An ANOVA hypothesis tests the difference in population means based on one characteristic or factor. a----->b "An example of when a one-way ANOVA could be used is if you want to determine if there is a difference in the mean height of stalks of three different types of seeds. Since there is more than one mean, you can use a one-way ANOVA since there is only one factor that could be making the heights different. " Two-Way ANOVA: An ANOVA hypothesis tests comparisons between populations based on multiple characteristics. a---->c<----b "Suppose that there are three different types of seeds, and the possibility that four different types of fertilizer is used, then you would want to use a two-way ANOVA. The mean height of the stalks could be different for a combination of several reasons" Multivariate analysis of variance (MANOVA): it is simply an ANOVA with several dependent variables. That is to say, ANOVA tests for the difference in means between two or more groups, while MANOVA tests for the difference in two or more vectors of means. a----->c, b------>d, a----->d, b----->c 

저작자 표시
신고

'Cat.Study Room > SubCat.Research' 카테고리의 다른 글

Comparison method for two groups  (0) 2017.01.10
Phase & Magnitude analysis in Fourier Transform  (0) 2016.10.17
DirectX Tessellation Strategy  (0) 2016.09.02
Likert Scale  (0) 2016.08.16
Two-alternative forced choice  (0) 2016.08.16
Depp Learning Surveys  (0) 2016.06.04

 

 

Save the memory :)

 

 

 

저작자 표시
신고

'Cat.Album' 카테고리의 다른 글

I got an award XD  (0) 2016.12.12
Get a happy ending. Ian.  (0) 2015.09.20
English comic site save  (0) 2015.08.18
Movie..  (0) 2015.08.15

In order to write a good newspaper article, following steps are highly recommended. 


1. Preliminary steps for writing an article. 


1.1  Collect credible information


  Once you've decided what you're going to write about article, you'll need to gather the information. Presenting a objective story to readers who have no knowledge is a big responsibility. Therefore, you'll want to collect as much well-researched and firsthand information as possible. 


1.2 Conduct interview


  News articles are enhanced by accounts from firsthand witnesses or people with expert opinions. Ask them a short but proper question to supplement information you present in your article. 


1.3 Perform a fact check


  You have a responsibility to present accurate information to your readers. Getting a wrong information may seem insignificant, but it has consequence; aside from trouble that could be caused by misinforming to public, your reliability as a journalist could come into question.  














+Reference

  http://www.wikihow.com/Write-a-Newspaper-Article






저작자 표시
신고

http://www.umiacs.umd.edu/~ramani/cmsc426/

저작자 표시
신고

+ Recent posts

티스토리 툴바