Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPL] HelloSmoke #122

Merged
merged 21 commits into from Nov 24, 2020
Merged

[IMPL] HelloSmoke #122

merged 21 commits into from Nov 24, 2020

Conversation

IngmarBitter
Copy link
Contributor

Sample that uses a 3d Texture of float values which are used by the shaders to create an impression of smoke. Introduces over the prior samples specifying a custom texel type and converting in the shaders from single value intensities to RGB.

@IngmarBitter IngmarBitter changed the title HelloSmoke [IMPL] HelloSmoke Nov 10, 2020
const uint TexturePixels = TextureDz * TextureDepth;
const uint TextureSize = TexturePixels * 4;

var texture3D = graphicsContext.Device.MemoryAllocator.CreateTexture(GraphicsTextureKind.ThreeDimensional, GraphicsResourceCpuAccess.None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same feedback as on #126 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a local variable before the call and make the call one line with the variable at the end of the line.

float scale = 2 * MathF.Abs(0.5f - radius);
// random value scaled by the above
float rand = (float)random.NextDouble();
if (!isQuickAndDirty && rand < 0.99)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!isQuickAndDirty && rand < 0.99)
if (!isQuickAndDirty && (rand < 0.99))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs the brace

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and with { ... } after the if, as in the comment above I assume.

@tannergooding tannergooding merged commit 187a9c8 into terrafx:main Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants