Code Monkey home page Code Monkey logo

occlusionculling's Introduction

DISCONTINUATION OF PROJECT

This project will no longer be maintained by Intel. Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project. Intel no longer accepts patches to this project. Software Occlusion Culling Sample Application

The technique used in this sample divides scene objects into occluders and occludees and culls occludees based on a depth comparison with the occluders that are software rasterized to the depth buffer. The sample code uses frustum culling and is optimized with Streaming SIMD Extensions (SSE) and Advanced Vector Extensions (AVX) instruction sets and multi-threading to achieve up to 8X performance speedup compared to a non-culled display of the sample scene.

For a detailed explanation, please see this article.

In addition to the technique detailed above, a separate Masked Occlusion Culling library has been included for comparison purposes, with its main up-to-date codebase being developed at https://github.com/GameTechDev/MaskedOcclusionCulling

As of late 2017 the Software Occlusion Culling Sample code is in the maintenance mode; reported bugs will be fixed but no upgrades are planned so far. However, Masked Occlusion Culling technique is still being actively developed.

Build Notes

The sample will not execute properly when run from within Visual Studio unless the 'Working Directory' is set to $(TargetDir).

Requirements

  • Windows 8 or later
  • Visual Studio 2015 or higher

occlusionculling's People

Contributors

codergirl42 avatar fstrugar avatar jeffersonmontgomery-intel avatar qfroemke avatar sfblackl-intel 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  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

occlusionculling's Issues

AVX2 instructions stop VS 2017 Debug build from running on AVX-only processors

MaskedOcclusionCullingPrivate::SetResolution() uses the intrinsic _mm256_set1_ps() which in the Debug|x64 build in Visual Studio 2017 (cl.exe version 19.10.25019) compiles to the register to register version of vbroadcastss which is an AVX2 instruction (according to https://en.wikipedia.org/wiki/Advanced_Vector_Extensions). Locally adding a lambda to replace this with the memory to register version appears to fix this:

	auto _mm256_set1_ps = [](float f)
	{
		return _mm256_broadcast_ss(&f);
	};

This doesn't appear required for the Release|x64 build which heavily flattens SetResolution().

Thanks for the great sample code!

Buffer over-run in CPUID code

From b15fdcf11b4390a606a6a91178358237279f4321 Mon Sep 17 00:00:00 2001
From: Daniel Silver [email protected]
Date: Sat, 24 Mar 2018 18:58:56 -0500
Subject: [PATCH] Fixed a buffer over-run bug in the CPUID code on certain
processors.


MaskedOcclusionCulling/MaskedOcclusionCulling.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp b/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp
index d5d0a78..15afac0 100644
--- a/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp
+++ b/MaskedOcclusionCulling/MaskedOcclusionCulling.cpp
@@ -54,7 +54,7 @@ static MaskedOcclusionCulling::Implementation DetectCPUFeatures(MaskedOcclusionC

 //cpuIdEx.resize(regs[0] - 0x80000000);
 size_t cpuIdExCount = regs[0] - 0x80000000;
  • CpuInfo * cpuIdEx = (CpuInfo*)alignedAlloc( 64, sizeof( CpuInfo ) * cpuIdCount );
  • CpuInfo * cpuIdEx = (CpuInfo*)alignedAlloc( 64, sizeof( CpuInfo ) * cpuIdExCount);

    for (size_t i = 0; i < cpuIdExCount; ++i)
    __cpuidex(cpuIdEx[i].regs, 0x80000000 + (int)i, 0);
    --
    2.16.1.windows.4

AVG frame rate wrong

This line should read like below.

total += mFPSAvg[mFPSInst];

	float total = 0.0f;
	for(int i = 0; i < AVG_FRAMES; i++)
	{
		total += mFPSAvg[i];
	}

Also, consider adding a \t in the output string to avoid the FPS counter jumping around.

swprintf_s(&wcstring[0], CPUT_MAX_STRING_LENGTH, _L("FPS:%.1f \t(AVG:%.1f)"), fps, total);

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.