Git Product home page Git Product logo

vulkanrenderer's Introduction

VulkanRenderer

This is a very basic renderer that is meant to be used in conjuction with the Game Physics In One Weekend book series.

It is currently only targeted for Windows 10 and Visual Studio 2019.

When you get the project to build and run, you should see a small sphere on top of a large sphere. This is the hello world of the book series.

Hello World

Usage

Scene.cpp is where you should begin writing the code from the book series. And sprinkled throughout the rest of the code will be comments:

// TODO: Add code here

This is where you would fill in the code snippets from the texts.

Controls

The controls for the renderer are very basic.

Mouse look to rotate the camera around the origin.
Scroll to zoom.
"R" to reset the scene.
"T" to pause and unpause time.
"Y" to step the simulation by a single frame (only works when the simulation is paused).

Vulkan Resources

Although this "renderer" uses Vulkan, it is not intended as a resource for learning it. Instead, I recommend the following:

https://vulkan-tutorial.com/

https://www.fasterthan.life/blog/2017/7/11/i-am-graphics-and-so-can-you-part-1

https://github.com/SaschaWillems/Vulkan

https://www.lunarg.com/vulkan-sdk/

https://vkguide.dev/

https://zeux.io/2020/02/27/writing-an-efficient-vulkan-renderer/

vulkanrenderer's People

Contributors

gamephysicsweekend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vulkanrenderer's Issues

Internal Torque

Thanks for the great book!
I've completed the first one but I couldn't really grasp this part 100%.
I was wondering if you could point to any resources where I could see, in particularly, where 'r = w x I.w' comes from?

Probably it's derived from the other equations in the book but I couldn't figure it out.

// Total Torque is equal to external applied torques + internal torque (precession)

Game Physics in One Weekend Issue with angular velocity and friction?

Hi,

Love the book and it's really helped me get some physics into my in development game engine.

I wanted to share that I think there is an issue in the angular velocity and friction example. My sphere never rotated whenever it impacted the ground and first I thought it was some mistake in my code with the calculation of angular velocity and the impulses but then I noticed you have the ground have its m_friction set to 0.0f. This makes total friction 0.

In my readings elsewhere, I believe that any contact where there is no friction for a sphere with its center of mass equal to that of its position would result in no rotations at all. Correct me if I am wrong here please as I am very new to game physics.

I had to set the ground friction to something other than 0.0f (I set it 1.0f) in order to achieve a result which looks realistic (at least to my eyes).

P.S - I could not find any contact information and anywhere else to share feedback or issues found in the book so posted it here. If this is not the right place, let me know.

When I try to generate more than 216 spheres, strange bugs happen when rendering

When I use the following code, everything works normally:

// Dynamic Bodies
for (int x = 0; x < 6; x++) {
for (int y = 0; y < 6; y++) {
float radius = 0.5f;
float xx = float(x - 1) * radius * 2;
float yy = float(y - 1) * radius * 2;
body.m_position = Vec3(xx, yy, 10.0f);
body.m_orientation = Quat(0, 0, 0, 1);
body.m_linearVelocity.Zero();
body.m_invMass = 1.0f;
body.m_elasticity = 0.5f;
body.m_friction = 0.5f;
body.m_shape = new ShapeSphere(radius);
m_bodies.push_back(body);
}
}

But if I change the limits from 6 to 15, it will happen:

image

If I move the mouse, strange things happen ... What could be wrong?

Thank you for the excellent book!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.