This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* FiberTaskingLib - A tasking library that uses fibers for efficient task switching | |
* | |
* This library was created as a proof of concept of the ideas presented by | |
* Christian Gyrling in his 2015 GDC Talk 'Parallelizing the Naughty Dog Engine Using Fibers' | |
* | |
* http://gdcvault.com/play/1022186/Parallelizing-the-Naughty-Dog-Engine | |
* | |
* FiberTaskingLib is the legal property of Adrian Astley | |
* Copyright Adrian Astley 2015 - 2018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Consumer(FiberTaskingLib::TaskScheduler *taskScheduler, void *arg) { | |
// No-Op | |
} | |
void Producer(FiberTaskingLib::TaskScheduler *taskScheduler, void *arg) { | |
FiberTaskingLib::Task *tasks = new FiberTaskingLib::Task[kNumConsumerTasks]; | |
for (uint i = 0; i < kNumConsumerTasks; ++i) { | |
tasks[i] = { Consumer, arg }; | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
void transBlitFrom(const Surface &src, const Common::Rect &srcRect, const Surface *dest, const Common::Rect &destRect, uint transColor, bool flipped, uint overrideColor) { | |
int scaleX = SCALE_THRESHOLD * srcRect.width() / destRect.width(); | |
int scaleY = SCALE_THRESHOLD * srcRect.height() / destRect.height(); | |
// Loop through drawing output lines | |
for (int destY = destRect.top, scaleYCtr = 0; destY < destRect.bottom; ++destY, scaleYCtr += scaleY) { | |
if (destY < 0 || destY >= dest->h) | |
continue; | |
const T *srcLine = (const T *)src.getBasePtr(0, scaleYCtr / SCALE_THRESHOLD); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"SolutionName": "MyApp", | |
"Projects": [ | |
{ | |
"ProjectName": "ProjectAwesomeSauce", | |
"ConfigurationDefinitions": [ | |
{ | |
"Configuration": "Debug", | |
"Platform": "Win32", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My question is: | |
How do you convert a light color and luminous power in the editor into a single color for use in the shader. | |
Let me explain. In listing 4 of the course notes from 'Moving Frostbite to PBR', you show some sample code. The last line is: | |
float3 luminance = BSDF(...) * saturate(dot(N, L)) * lightColor * att; | |
What does 'lightColor' represent? Is it the color of the light multiplied with its luminous intensity? AKA: | |
Point light: lightColor = <RGB color specified in editor> * lumPower / 4 / PI; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ScummVM - Graphic Adventure Engine | |
* | |
* ScummVM is the legal property of its developers, whose names | |
* are too numerous to list here. Please refer to the COPYRIGHT | |
* file distributed with this source distribution. | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation; either version 2 | |
* of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In my shader code I retrieve a normal from spherical coordinates. | |
// The normal *should* be (0.0f, 0.0f, 1.0f), but due to some encoding errors | |
// it's a little bit off. I'm ok with that. However, when the value is used as | |
// is, it causes odd errors with the dot product or normalization. | |
// Here is an example. normal is calculated as above. lightVector comes in as | |
// a cbuffer variable. I've used shader debugging to verify the values of each. | |
// If I dot them directly, I get zero, when the product should be about 0.56 | |
float3 normal = float3(0.0f, 0.0f, 0.9999900f); |
NewerOlder