• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Search the Community

Showing results for tags 'DX11'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • News

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Audio Jobs
  • Business Jobs
  • Game Design Jobs
  • Programming Jobs
  • Visual Arts Jobs

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Topical
    • Virtual and Augmented Reality
    • News
  • Community
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
    • For Beginners
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams

Blogs

  • Michael Tanczos.. Gamedev.net code monkey
  • So much for Creativity
  • The nearsighted one cometh
  • Kylotan's Developer Journal
  • Rabbit Droppings
  • The Code Zone Bargain Basement Blog
  • Author, Programmer, Bag of Wind(TM)
  • Journal of Sneftel
  • Strife's Most Excellent Journal
  • Readme.txt
  • Journal of Null and Void
  • Dirty Hacks and Stupid Tricks
  • This is not a blog
  • Continuous Refinement
  • 23yrold3yrold's excessively awesome journal
  • Journal of Tiffany_Smith
  • Journal of The God
  • Journal of void*
  • Journal of UknowsI
  • The Mothership Connection
  • Journal of Sandman
  • Gaiiden's Scroll
  • Journal of LessBread
  • mittentacular
  • Journal of adventuredesign
  • Journal of WitchLord
  • Journal of cone3d
  • Ian's Blog Rants
  • Is this thing on?
  • There is no escape from the Washu
  • /* Why you crying? */
  • Journal #259850
  • Journal of Yann L
  • Fortress of Solitude
  • Insignificant Corner on the Wild Wild Web
  • T. Wade Murphy - Sketchbook
  • Journal of Woodsman
  • Journal of kevmo
  • Not dead...
  • Working late past midnight...
  • Journal of pi_equals_3
  • Adventures in Game Production
  • Journal of Drewish
  • Development, OSS, and pie at work
  • Rarely Spoken
  • evolutional.co.uk
  • Welcome to the bowels of hell
  • Journal of danbrown
  • Journal of __Daedalus__
  • Journal of a Magical Badger
  • The Mad World Of Me
  • Perpetual Alpha
  • Journal of Buzzy
  • The Storytelling Ape
  • Untitled
  • Reminiscence
  • Big Sassy's Ramblings
  • Journal of dthorp
  • Journal of benstr
  • Journal of Prairie
  • The Simplest Thing That Could Possibly Work
  • Journal of eklypse
  • Journal of falkone
  • Let
  • Journal of DarkZoulz
  • 0_o
  • Adagio for GameDev
  • MEY - Archive
  • Journal of Ysaneya
  • A constant battle with time
  • Journal of CoffeeMug
  • Journal of Clash
  • My personal space of thoughts...
  • Journal of Void
  • Journal of xEricx
  • Jorgander's journal
  • Journal of mohaps
  • Journal of SEHenley
  • Journal of EricMeyer
  • A view from the trenches
  • Journal of LorenTapia
  • Incoherent Ramblings of a Madman
  • Journal of _zombie
  • FRIZZLEFRY!
  • Journal of IronWolf
  • Designing: The Game and Its Content
  • Fuzzlr
  • Journal of Deltah
  • Game Development of the Graphics Type
  • Journal of IndyHood
  • Raptor's Den
  • Journal of Scott
  • Journal of NafdahliX
  • Journal of Stoffel
  • Journal of the Digital Hobos
  • J3's Joint
  • The NoMonkey Experience
  • Codex of the Modemancer
  • Journal of Blivvy
  • My Thoughts and Progress
  • Journal of Mulligan
  • Boring banter of a programmer.
  • The mighty journal of Raymondo
  • Journal of Nurgle
  • Journal of Bossk
  • Journal of DJHoy
  • One bastard's rants
  • Reprogramming my brain
  • Building the Sphere, one vertex at a time.
  • Journal of Kraiklyn
  • Journal of MonkeyChuff
  • Journal of jakem3s90
  • Journal of Shred
  • Journal of Erluk
  • Ramblings of a Red Dwarf addict
  • Beginnings of the Wayward Programmer
  • Journal of mattnewport
  • Journal of iNsAn1tY
  • MMO Indie? Can't Be Done
  • Journal of CGameProgrammer
  • Journal of scarmiglion
  • Mmm...soylent green...
  • _luridcortex
  • Journal of SeanHowe
  • Journal of Zophar
  • Journal of glincoln
  • Daedalus Development
  • World of Sshado
  • My GameDev Journal
  • Shell extensions, code design and fluff
  • Deux
  • Eh
  • A Keyboard and the Truth
  • The Unofficial 'Empyrean Gate' Journal
  • Journal of whaleyboy
  • Journal of RobertC
  • Journal of James Trotter
  • The Barracks
  • Untitled
  • Don't Click Here
  • Stupid .NET Tricks
  • Journal of JimboC
  • iosys Research and Development Journal
  • ... And on the 8th day, God created Pouya ...
  • Angry Cuttlefish's Fishtank
  • SteelGolem
  • Journal of onehundred
  • Drakkcon's journal
  • Alexmoura's Journal
  • Journal of thesadjester
  • zdlr's game development journal
  • Destructive Design
  • You are all weirdos.
  • Train of Thought
  • Andy Pandy's Magical Journal of DOOM
  • Any Colour You Like
  • Inane Ravings of a Mad Engineer
  • Adventures In Managed World
  • Compiling...executing...recompiling
  • Journal of codemonster
  • Journalgasm
  • Journal of digisoap
  • So long, Gamedev.
  • Journal of hothead
  • For The Storm! a Tribute to Netstorm :)
  • Journal of Magmai Kai Holmlor
  • Journal of JoeDorson
  • Amazing Journal
  • Journal of John Swidorski
  • Journal of benutne
  • Journal of caffeineaddict
  • Journal of Antonie_Bouman
  • Journal of Thygrrr
  • In Which Christopher Robin Buys Some Cheese
  • The Monkey Digest
  • Jinxed
  • Rixter by Rixter by Rixter by Rixter
  • Journal of Cold_Steel
  • NanoTera
  • Journal of MagicScript
  • Journal of a struggling Student
  • MyJournal.lnk
  • Journal of doomhunk
  • Sir Code Alot's Codex
  • Unbreakable
  • Journal of lethalhamster
  • Brain Drain
  • Journal of uto314
  • Not your journal.
  • Computer food
  • Journal of The Frugal Gourmet
  • Digital Scrawl
  • Journal of ToohrVyk
  • Journal of graveyard filla
  • A look into the mind of TheNobleOne
  • Journal of BioMors
  • "That wasn't dirty dancing, it was Salsa"
  • Brandon N's Journal
  • Journal of HughG
  • DogCity Adventures
  • Programmology
  • Journal of Bluehair_fr
  • Graham's Incessant Ramblings (gwihlidal)
  • noaktree leaves
  • ElJournalo
  • Booleans spiffy development journal
  • Journal of Pants
  • coldacid.dev.journal
  • Simple Foolishness :: Just What I Like
  • Journal of Raduprv
  • Journal of Prozak
  • Dave, The Mystical Workings Of...
  • Journal of kentcb
  • Rhaal's Journal
  • Journal of evillive2
  • mobile chronicles
  • Proverbial Max
  • Codename: Karma Online
  • krez's Amazingly Entertaining and Informative Journal
  • The Re-education of Maik Vidales
  • Ols (Away)
  • Yar
  • Writing Web Games
  • What's going on at TDLGames or TDLSoftware
  • DruinkJournal
  • The Meaning of Nahrix
  • Journal of Obscure
  • Drawing Lightning
  • Metaphorical Journeys of Happenstance
  • Journal of Eddie Hicks
  • Ubertainment
  • DavidRM's GDC Coverage
  • Sande's GDC Blog
  • Journal of KellyM
  • joanusdmentia::journal
  • Stompy's Gamedev Journal
  • How to finish a game in less than ten years
  • The Long Road to Making Games
  • Journal
  • Unhandled Exception
  • Journal of cm2
  • Journal of SanityAssassin
  • The sleeper must awaken... and code some.
  • Devnull's Log o' Geekery
  • markr's complete waste of time
  • Ahhh! I think I'm melting!
  • Journal of MrP
  • rhummer's Journal
  • Journal of CyberSlag5k
  • Journal of scubabbl
  • Journal of BlueDev
  • Journal of chadmeyers
  • Journal of Raisor
  • Journal of Undergamer
  • Journal of Hedos
  • Journal of robpers2003
  • Journal of NeHe
  • Nothing much of interest...
  • The Realm of Trial
  • Starving Programmer - Will code for food!
  • Journal of iduchesne
  • Journal of Kippesoep
  • On the path with a ramblin' man
  • You Gotta Squeeze Every Pixel
  • Lame? Where?!
  • Journey into a 3D World
  • Child of GDNet
  • Journal of finch
  • Journal of Hakiko
  • Journal of Lenox
  • Journal of LastUnicron
  • MrEvil's Journal
  • Journal of evelyn
  • Journal de S'Greth
  • donjonsons thoughts
  • Journal of dotnetted
  • The Tub of Awesome
  • Journal of EnemyBoss
  • Triangular Pixels
  • Radioactive-Software
  • Ubik
  • Journal of wasted_druid
  • Level-Grind Online
  • Journal of adam17
  • Sir Sapo... The Man ... The Legend
  • An Artist's Ramblings
  • Journal of LiyonDR
  • Thoughts from a Wanna Be Producer
  • Independent thoughts of PaulECoyote
  • Journal of Lab-Rat
  • Journal of Revelations
  • Gauntlets of Recursion (+3)
  • Journey to the Ancient Galaxy
  • Random things uavfun thinks are cool
  • NickGeorgia's GameDev Journal
  • Journal of jonpolly99
  • Brutally honest game dev stories
  • Journal of Lacutis
  • Clever Title
  • Beals Software
  • Journal of TheArtifex
  • Journal of Ranger Meldon
  • Journal of Pestilence64
  • Journal of jyk
  • Kudu's GameDev Blog
  • Tech: Arena
  • Journal of skittleo
  • Shiny Journal of Programmingness
  • Journal of LamerGamer
  • Programming. Academics. Life
  • Journal of unazona
  • Journal of CalvinCoder
  • Adventures in 3D
  • Journal of tstrimp
  • Journal of Xiachunyi
  • Journal of QuadMV
  • Neutrally Buoyant in a Sea of Productivity
  • Cypher's Journal
  • Journal of Nomad010
  • Journal of a freak
  • Journal of dcosborn
  • Journal of Nagashi
  • The XNA Struggle
  • Journal of Mrs Kensington
  • Journal of heavygearz
  • J of K
  • Journal of MikeWW
  • Distilled Brilliance
  • Journal of EvDaedalus
  • Journal of WillC
  • Necron00bicon
  • Jemgine
  • Big Trouble In Little Chairtown
  • Satisfaction Guaranteed*
  • Journal of munKiecs
  • NetSim: A Hacking Simulator
  • Almost Lackadasical Gamedev
  • Journal of cppgirl
  • Journal of PennstateLion
  • Journal of sathenzar
  • Journal of Trading Route
  • Journal of RingTek
  • Journal of Aiursrage2k
  • Journal of Kalidor
  • The Bag of Holding
  • Journal of Sages
  • Journal of fur (p2pmud project)
  • Journal of Landsknecht
  • Joshua Pilkington's Journal
  • Journal of JoriathLionfort
  • Maddox's Best Friend
  • Primal Damage
  • The Rambloring of Beldamir
  • #ifdef TRAPPER_ZOID
  • Journal of IronGryphon
  • 1000 Monkeys
  • Horror Stories of RanBlade
  • UberFantasticoSuperJournalRahr!
  • Ascending the Lift Hill of Life
  • shilblog
  • "Another genius foiled by an incapable assistant."
  • Exploring infinity
  • Journal of meix
  • Journal of Impeller Head Games
  • The scriblings of Samsonite 2007 AD.
  • Kazade's GDNet Life
  • SteevR's Deadly Development Mistakes
  • IBTL
  • The Moonpod Insider
  • Journal
  • I update. You read. Ok?
  • Journal of pink_daisy
  • In The Beginning
  • We stumble at noonday as in the dark.
  • Journal of Zipster
  • Journal of fearghaill
  • Evolve Games
  • No ninjas here, no really they are over there.
  • Journal of Caitlin
  • Journal of _winterdyne_
  • Journal of PreditorX0789
  • Journal of TyroWorks
  • Journal of AfroFire
  • The Whine Cellar
  • Journal of bargasteh
  • Journal of LilBudyWizer
  • Journal of CTar
  • Journal of furin121
  • Journal of Khaos Dragon
  • Untitled
  • Sheridan's adventures in random nonsense.
  • Nitrous Butterfly Developer Journal
  • Journal of Mephs
  • Journal of Nuget5555
  • Journal of xaver
  • Journal of Fahrenheit451
  • Captaiz Z
  • Journal of nts
  • Journal of rodgaskins
  • Chronicles of the Hieroglyph
  • Journal of Kuro
  • The Life of Corman
  • Journal of Kria Krabbit
  • Abwood's Coding Notes
  • extralongjournal
  • A love story: Me and my 2D engine.
  • Journal of sBibi
  • Journal of necreia
  • Dzz's Journal
  • Journal of Jervin
  • The journal of rpg_code_master
  • 2D Game Development with a splash of Mumbo Jumbo
  • Journal of Mordt
  • Journal of paradoxnj
  • The Wayward Druid
  • Journal of Tera_Dragon
  • darkpanda's awakening
  • Journal of Downer
  • Journal of RageHard
  • Journal of TommyA
  • Journal of kylecrass
  • Destination: Failure
  • Ye Olde Ramblings
  • Journal of Johnny Casil
  • Journal of C J W
  • Krizo
  • Journal of Zao
  • Journal of socrates200X
  • Journal of chapmast
  • Journal of rjhcomputers
  • The Broken Mind
  • Journal of ebner-wilson
  • Journal of SKREAMZ
  • Journal of astralvoid
  • Graphics is gooder and stuff
  • Journal of Talonius
  • Explicity undeclared yet implicitly defined ramble
  • UofU Team Journal
  • Journal of thedott
  • I am a duck
  • Delusions of Grandeur
  • Journal of kirkd
  • Exploration of pie and caek
  • Journal of slowpid
  • It's a hobby.
  • Subverting C++
  • Journal of Dreddnafious Maelstrom
  • Journal of marmin
  • Monkey Land
  • Dev. Blog of Empire Productions
  • Wiiiiiiiiiiiiiiiiiiiiiiiii!!
  • Slow progress
  • Journal of trailervoice
  • Illusive Studios
  • Journal of MindWipe
  • Journal of kmccusker
  • Ramblings of a partialy sane programmer
  • My Game programming journey
  • Adventures in Text-mode
  • Better Together
  • Journal of Kyle N
  • Journal of Genesis : Origins
  • NO
  • Project Kingstone
  • Brainfold
  • Journal of darkzim
  • Journal of jkielpinski
  • Dovyman's Journal
  • Journal of Goober King
  • Adventure Owns You
  • Journal of Sentientv2
  • Journal of mistermecha
  • Journal of sipickles
  • Prodigious
  • Bradley Sward - Small Game Projects
  • El Nino Games
  • Journal of Trefall
  • Tesseract's Game Development Journal
  • Mark the Artist Fights the Future
  • PumpkinPieman's Journal.
  • Get back to work!
  • Journal of Kevinator
  • Journal of Charles Thomas
  • Journal of erwincoumans
  • Journal of Michael Nischt
  • Journal of ukdm
  • Journal of Andrew Fults
  • Level editor in the works
  • Good Enough?.... Never!
  • Wijnand's Game Journal
  • Odorless Entertainment
  • Journal of blimey
  • Milkshake's Dev Diary
  • Journal of dist0rted
  • Journal of -JetSirus-
  • Bandit Revolvers: Championship Edition!
  • Journal of the enemy
  • Journal of soconne
  • Journal of valles
  • Journal of Aardvajk
  • Frog Blog
  • Journal of GreenGiant
  • Journal of ArNy
  • Developing Firebox
  • Journal of John_23
  • Journal of Luminous
  • Journal of CloudNine
  • The Enigma Code
  • bricklayer developers: Fountaindale
  • Journal of The_Neverending_Loop
  • Abort Button Software
  • Journal of Xrystal
  • Journal of Stuart Y
  • Journal of Jesse_P
  • H3O + U-235
  • Journal of a Shaven Ape
  • metaverses
  • Journal of C0D3Name
  • Journal of binaryguy
  • Journal of a wannabe game programmer
  • Journal of Fortia
  • Journal of dracan
  • Journal of boto
  • iLiNX
  • Journal of a undecided
  • Journal of cwestbrook20
  • Yet Another Game Maker
  • Journal of smc
  • The Journal of Thraed, Shadow of Fahrenguard
  • Journal of webjeff
  • Journal of phantom-soft
  • The Wild West of Programming
  • Journal of tribalKris
  • shadowcomplex's stuffs
  • Journal of IceSynth
  • Journal of Tesl
  • Surreal Sensations
  • Journal of AlexLoren
  • Journal of Ronnie Howell
  • Indisputable Tales of Interest
  • Journal of KGodwin - Newbie Game Dev
  • Wills' Wishes
  • Journal of miminawewe
  • Journal of DavidNeal
  • soggyfries
  • Journal of Tallitus
  • Promit's Ventspace
  • Journal of FunLogic
  • Journal of cheops2007
  • Journal of Sensei Maku
  • A Developer's Dream
  • Journal of VanillaSnake21
  • The ballad of a n00b
  • Journal of mattdev
  • Your company name here
  • The Richest Beggar in the World
  • Synbios128's Journal
  • Journal of AnthonyN1974
  • Journal of acappella
  • Journal of deerslyr1
  • Journal of Dragoro
  • Journal of Damon501
  • This Is My Story
  • Evil Stick Man in Evil Stick Land
  • Journal of noNchaoTic
  • Journal of Journaling
  • Phyletic gradualism
  • Fallen, oh dear :
  • The Byproduct of Facts and Fiction
  • Journal of Adam Hamilton
  • WISP
  • The Lion amongst the code
  • Abliss Gamedev
  • Once a Bird
  • Yeah
  • Journal of ShaneHeres
  • Orbital Fan's game development journal
  • Journal of VikingDK
  • Journal of zedz
  • Kiryn's Development
  • Defeating procrastination one post at a time!
  • Journal of HeftiSchlumpf
  • Journal of Scint
  • Journal of MattWhite06
  • Journal of Funkymunky
  • Under a ShadowyTree
  • Frogames adventures
  • Journal of Treesong
  • Brandogon's Journal
  • Alaklin's workshop
  • The never-ending story...
  • Journal of GreenToad
  • Journal of TiredofSleep
  • CAN Games Development Journal
  • What is Interactive Art?
  • Verg-o-nomics
  • Excursions into the Unknown
  • My Epiphany
  • Brain spasm
  • Brian Hoffer's Journal
  • BrokenThorn Entertainment
  • Journal of terry_burns85
  • Old code never dies, it just fades away
  • Journal of ChrisE
  • Journal of ShadowRancher
  • Journal of Dark Matter
  • Journal of mikalar
  • Journal of Moss
  • The Mystic work of Chad
  • Jason's journal
  • UserJP's Journal of Doom +4 ( Imbued with Fire )
  • Quanta's Journal
  • Journal of InnocuousFox
  • JasonP Works It
  • Every Semicolon
  • Data Spire
  • Blue stain
  • Journal of hashin
  • Journal of s3r1n
  • IndieZen Developers Journal
  • OddGames development journal
  • Journal of rvdwerf
  • Memoirs of a Graphics Engine
  • Journal of DraconisRavenix
  • Journal of dbaumgart
  • Journal of Nytegard
  • Archipelago
  • The truth between the lies
  • Journal of kornman00
  • Journal of EvanWeeks
  • Journal of _ArmuT_
  • Journal of stenol26
  • Journal of Besome Games
  • Journal of Palish
  • Journal of binchawpz
  • Magpie
  • MJP's Last Stand
  • Journal of theOneAwaited
  • Journal of EliteCoder
  • Journal of Pluvious
  • Journal of Veslefrikk
  • Journal of Vyper_uk
  • Journal of ExcessNeo
  • Mammal Games
  • Journal of Rascal
  • Laura's Game Journal
  • Robot, Ninja, Pirate, Monkey
  • Journal of Synthros
  • Journal of PsychoPumpkin
  • Rex of the Arx
  • Leandro's endeavours on managed code land
  • Journal of Moore452
  • Chronic Procrastination
  • Journal of Lode
  • Z Axis Games
  • Frisson
  • Journal of +1Games
  • Journal of kapilkapre
  • Journal of Taharez
  • Journal of xtBones
  • Journal of tinac2008
  • Life in the cereal box....
  • Journal of SilentSiren
  • Omegaice's Dev Journal
  • MMORPG Development
  • Journal of NowSayPillow
  • Pixelante
  • nerd_boy's journal
  • Journal of Remus Turcuman
  • The Log: Cloud Ocean
  • Journal of Jaap1978
  • Journal of Mak
  • Journal of lucius
  • Don't forget, it's supposed to be fun!
  • Journal of DarkPsychosis
  • Journal of rolkA
  • Journal of Sastrugi
  • Journal of 4fingers
  • Journal of nsmadsen
  • Just Glad to Be Here
  • Journal of MS Larsen
  • Ep's tool-dev diary
  • lightassassin.log
  • Journal of 2disbetter
  • Crawling with ideas
  • Journal of nightwreath
  • IfThen Software
  • Academia
  • Journal of ID Merlin
  • Journal of digitalerr0r
  • Journal of Hi Speed
  • Journal of Anexa85
  • Journal of ZootSuitGames
  • Journal of jrmcv
  • Journal of Earthania
  • Journal of Lethargic Programmers
  • The Adventures of a Universal Traveller
  • Merry Prankster Games
  • Journal of caldiar
  • Journal of Darkrider0318
  • Journal of davepermen
  • Journal of Encicra
  • Software Renderer in 28 days
  • Journal of DrSizzla
  • Journal of brainstyler
  • Journal of linternet
  • Journal of matt_j
  • Untitled
  • Journal of m3sh
  • My Newbie GD Journal
  • Journal of smr
  • Drew_Benton
  • Journal of FeverGames
  • Windows [Phone | 8] musings
  • Journal of popcorn
  • Journal of gytha
  • Isolate Development
  • Journal of MrCpaw
  • The Pixel Ocean
  • Journal of Zubski
  • Journal of inferno82
  • Journal of mikeman
  • Starting Thoughts
  • Journal of stimarco
  • dwn
  • Tachyon Wars
  • Journal of AndrewA
  • Journal of rip-off
  • Treehouse Gaming
  • Journal of Tom
  • Journal of rohde
  • Journal of wicked357
  • Journal of Roo Avery
  • Journal of Tower City
  • Journal of geekster
  • Graphics Engine Development
  • Journal of hGonzalez
  • Journal of Caste
  • Skipping a D
  • Journal of Matt328
  • Elucidation
  • Battlefield simulation engine
  • Journal of AEdmonds
  • DudeMiester Speaks!
  • Technical Artistry
  • Journal of Exide
  • Mason's Journal
  • istar's Game Life
  • The Greatest Development Journal Ever Written
  • A Traveller's Tale
  • Journal of foursticksj
  • Robot University -- a 2D DirectX Puzzle
  • Journal of KnivesAldren
  • Journal of jerrywilkins
  • Tales from the Veggie Patch
  • Journal of jnbutler
  • Lonely Hearts Club
  • Journal of Rakshasa
  • Journal of OmegaDog
  • Journal of Machaira
  • Journal of damix911
  • Journal of Richard Geslot
  • Dark Horse Software
  • Digital adventures through the third dimension
  • Gnoblins - Development journal of an indie game
  • Journal of ThomasBelgium
  • Wavesonics Pseudo-Random Journal Generator
  • Yckx's GameDev Journal
  • Tales of Ozak
  • Journal of nes8bit
  • Journal of bgund001
  • tinyrocket
  • Think Small
  • The YAR Project
  • Journal of Christopher Loyd
  • Journal of Vanderry
  • Journal of Ariste
  • Journal of namar777
  • Feathers and Code
  • Journal of Mussi
  • Dans Journal
  • Journal of Drakonite
  • Wilhelm's Journal
  • Journal of Laval B
  • Journal of Sybalos
  • Journal of dx elliot
  • True, False, Maybe
  • Journal of dragongame
  • Journal of ManuelMarino
  • Journal of wpalmer
  • Journal of KezraPlanes
  • ProgrammerMattC's Journal
  • Journal of reversinguy
  • Rants Etc.
  • Journal of daveodonoghue
  • Journal of Lunarjax
  • Journal of ShabbaStoney
  • Journal of Dwarf King
  • Journal of Lee Stripp
  • Rendering Systems
  • My C++ Journey
  • Journal of LarryWP
  • Journal of Daivuk
  • Journal of spacemoses
  • Journal of Sam Hagelund
  • #!/Bin/Bash-ObsidianBlk
  • etodd makes games
  • liger13's Blog
  • zer0wolf's Blog
  • davepermen's Blog
  • SageKri's Blog
  • Neutrix's Blog
  • speciesUnknown's Blog
  • FAR Colony's Blog
  • megamoscha's Blog
  • In the year 4016...
  • Lightning Engine
  • kiwibonga's Blog
  • Revenge of a Buzz Saw
  • InvalidPointer's Internets Rambling
  • KulSeran's Blog
  • Drilian's House of Game Development
  • alfith's
  • Ravyne's Blog of Blogs
  • cowsarenotevil's Blog
  • AndrewBC's Blog
  • JoeDev
  • Uncertanities, pitfalls and lesssons
  • martin_bfg10k's Blog
  • ScottsCreations' Blog
  • The Journal Of Luckless
  • Pixel ? Tile ? World
  • Fastcall's Development Blog
  • Blog 3.0
  • owl's Blog
  • dwarfsoft [GPA]
  • Seaßourne's Blog
  • mytre's Blog
  • Kevin's Blog
  • Gaetano Lenoci GameDev Blog
  • chench's Blog
  • fcoelho's Blog
  • Shozan's Quest
  • A Zombie Wedding
  • TheHinch
  • Dev Notes
  • kseh's blog
  • MichaelT's Blog
  • Mastrgamr's Blog
  • Life in Code
  • Mental(FrameRate)
  • The Animal Farm GameDev Blog
  • brslocum's Blog
  • Lost in the Catacombs of Game Development
  • LambdaRogue Development Blog
  • In the Shade
  • Moe's Blog
  • (O_o)
  • Blog
  • Scourage's Blog
  • Tocs' Blog
  • Ezbez's Blog
  • Liheike's Blog
  • Blendium's Blog
  • Madhed's Blog
  • Out Of The Ashes
  • stonemetal's Blog
  • Lords of Midnight Development
  • MarcotteR's Adventures in Research and Development
  • Coding in the Fast Lane
  • Lavinski's Blog
  • Leadwerks Developer Blog
  • MaskedAvenger's Blog
  • XXChester's Blog
  • Just Let It Trickle
  • assainator's Blog
  • Okiedoke!
  • HzerDown's Blog
  • Random Rantings
  • diablos_blade's Blog
  • Airy's Blog
  • HydroxicAcid
  • Igroman's Blog
  • Imgelling's Blog
  • px's cleverly named blog
  • JamesPenny's Blog
  • LogicalError's Blog
  • Splinter of Chaos' Blog
  • The Game Prodigy - GameDev.net Edition
  • Retronator
  • Rulers of the Known Universe
  • Exiled Dimension
  • Katerina's Blog
  • kasonerap's Blog
  • Crage Games' Blog
  • Mastering MMORPG3
  • Emotion Rays DevBlog
  • Adam Omega
  • The duckpond
  • Cross Mobile Gaming
  • Henry Prescott's Portfolio
  • 15 minutes of fame and an eternity of shame
  • Kristof's Game Dev Blog
  • wakahana's Blog
  • sdaq overflow
  • Kimmi's developer blog
  • Lightning Bolt Games
  • Tutorials By Andy Esser
  • BulletOtaku Games Journal
  • Eclision Programming Team
  • New Old Things
  • They don't teach this stuff in school
  • Glow engine Journal
  • Drennen's Journal
  • Jake's Journal
  • A non-programmer's programs
  • Hexagon's Journal
  • Mobeen's Journal
  • EndersGames' Journal
  • Minastas Games
  • Ali Akbar's Journal
  • Butabee's Journal
  • Dragon's Nest
  • Stop playing, start coding!
  • G-Truc Creation
  • Ninja GD
  • Slav2's Journal
  • NickyB's Journal
  • Jastiv's Journal
  • PARPG development blog
  • Romnia007's Journal
  • rachoac's Journal
  • Product Review Blog
  • developing gordebak
  • AciDGraphit3's Journal
  • SFAgent24 Developer Journal
  • Milcho's Journal
  • MikeTacular's Journal
  • The Start and Journey of Sound Creation
  • GDC 2011
  • Hypnotron's Saga
  • glaeken's Journal
  • Robot Ramblings
  • vicviper's Journal
  • jMonkey Business
  • Project Simplicity
  • alphablackzer0's Journal
  • gasto's Journal
  • InfectiousGames Brand NEW journal!!
  • GuardStar's Journal
  • MysteryMeat's Journal
  • deks' Journal
  • T-JAM Studios Journal
  • sk84z's Journal
  • Dace's Journal
  • Adrenaline's First Huge Project
  • Digivance Game Studios
  • Tomasz Dabrowski's Journal
  • Jacobean's Journal
  • Quiet Ponderation
  • Peter Vaughn's Journal
  • J-Snake's Journal
  • nomura's Journal
  • Opt7ons' Journal
  • gharen2's Journal
  • SymphonyOfDream's Journal
  • standingguy's Journal
  • ArtyjayStudios: A fistful of fail.
  • 3D BYTE Technology Blog
  • Aeroflot's Journal
  • Michael J Pierce
  • Datahammer dev blog
  • Bullet Points
  • Sappharos' Journal
  • Pendragon274's Journal
  • Daniel E's Journal
  • From Nothing to Everything
  • ballerplaya's Game Dev Blog
  • Twisted Shield Interactive
  • Menopia's Journal
  • The Legends of racoiaws
  • Andrew Kabakwu's Journal
  • BlueGlutton's Journal
  • StudioZx Journal
  • Lucas Daltro's Journal
  • zerothrillz's Journal
  • GameDev.net Staff Journal Old
  • Matthew Wood's Journal
  • RedPin's Game Jorunal
  • DeeMOONger's Journal
  • Locke's Game Dev
  • Lloyent's Journal
  • Wildlander's development blog
  • AmzBee's Journal
  • Kaushik's Journal
  • Shawn Hargreaves' Blog
  • Xerron's Journal
  • Mario Cavett's Journal
  • BauAir Studios
  • Jacob Gardner's Journal
  • TiagoCosta's Journal
  • Cypharr's Journal
  • loveworld99's Journal
  • Songbird's Journal
  • Oddbird Games
  • IsNe's Programming Journal
  • Firework Factory Development Journal
  • TheLogster's Journal
  • Little Coding Fox's Journal Of Exotic Adventures
  • Hexagon2D
  • TKE Super Dave's Journal
  • andi's Journal
  • Tim Sarbin's Open Wars Journal
  • Jaye's Journal
  • Vermaelen's Journal
  • The 'Massive' Project
  • Marek A. Krzeminski, MASc
  • The Road Less Traveled
  • Inclemency Studios Log
  • Short-Story about Meteora(My dev team)
  • Fox89's Journal
  • Trivigy's Journal
  • FetDaniel's Journal
  • Browser based RTS in the making
  • MortenB's Journal
  • LastContract
  • Developer Quest: Journey of Hope
  • Mayatrone's Journal
  • Vaguely In Focus
  • Starting up as a new company
  • __Homer__'s Journal
  • Sketching the Surface
  • Fubar the game - Developers Journal
  • StephanieRct's Journal
  • daver64's Journal
  • Mozly's Journal
  • Venfer's Riddle RPG/Puzzle game devjour
  • The AdaptivElite Developer's Journal
  • resell4's Journal
  • 2pacfarrar's Journal
  • Karim Kenawy's Journal
  • bandicootzcrib's Journal
  • grandiz3r's final gaming assault
  • ElementCy's Journal
  • Shadows, instruments and ohh my
  • Rattrap's Journal
  • XDaWNeDX's Journal
  • Eliad Moshe's Journal
  • ChugginWindex's Journal
  • Slyxsith's Journal
  • MutedVision
  • r1ckparker's Journal
  • ashkan_203's Journal
  • Project: CharWars
  • luckeytree's Journal
  • Journal of Suspense
  • PREDATOR_UK's Journal
  • Walking Towards The Sun
  • Trucking on
  • Zeypher Rise to Power
  • Keeping up with yesterday
  • vibrunazo's Journal
  • tangentstar's Journal
  • Accountability Journal
  • carlosx's Journal
  • EtherFields' Journal
  • mobilus' Journal
  • AnotherGS' Blog
  • Web by Day, Games by Night.
  • void* journal
  • N.O.W.
  • sosa's Journal
  • Cam's DevLog
  • Disciple of Jonato
  • StarDust DevLog
  • Paradigma11's Journal
  • GSoC '11 - Mono Runtime
  • D Bits
  • The Design Conundrum
  • DrTorte's Journal
  • Mobile RPG
  • 5MinuteGaming's Journal
  • KingofSwing94's Journal
  • Arc Fusion Games' Journal
  • ebontide's Journal
  • Yang G's Journal
  • Arcade Zombies
  • Xaviarrob's Journal
  • Stepping into demons lair
  • Rodimus and Unity
  • Linkfan88's block world journal
  • MeowMeow's Journal
  • A shooter game for all ages
  • The Failure Epiphany
  • Bregma's Persistent World
  • Nik02's Journal
  • lask1's Journal
  • Vic's Journal
  • sketckasketch's Journal
  • Last Engine
  • nife
  • Booniverse
  • Muzz5's Insane Witterings
  • Joe Storm's Journal
  • Switchblade_77's Journal
  • Eiffel's Journal
  • Graphics & Games... or the other way around
  • phara0h's Journal
  • IggyT's Journal
  • ElusiveCoder's Journal
  • Thoughts and Opinions
  • scout113's Journal
  • notyourbuddy's Journal
  • MERKB's Journal
  • Mr Moose's Journal
  • AAKN's Journal
  • TheEvilMuffinator's Epic Adventure
  • Cat Scratchings
  • FreeStejler's Journal
  • Gerónimo Garcia, a game developer
  • zacaj.devlog
  • TC's Journal
  • Luc the Whiny Wind Boy's Journal
  • Tactical Recon Dev Journal
  • OmensDev's Journal
  • OMG NUB!
  • Irvin's Journal
  • ZSG Development Journal
  • MrCodeSushi - Raw and Tasty Code!
  • bls61793's Journal
  • 3D Models for Games
  • T e c h l o r d's Journal
  • Santisan's Journal
  • ZenithSal's Journal
  • Reflections of a Mindless Individual
  • Polar's Journal
  • RetLee's Journal
  • Journey To Hammerdale Devlogs
  • BigDaveDev's Journal
  • bugbuster77's Journal
  • Survivor Game Journal
  • GoofProg.F's Journal
  • gash's Journal
  • Ghavami
  • blltdgr's Journal
  • marcelomp's Journal
  • ZARS Dev Journal
  • Joe P's Journal
  • Discouraged Programmer
  • Real Time RayTracing and implicit modeling
  • Space Exploration/Action RPG hybrid reliant on UGC
  • Random Developments
  • The Newbie Chronicles
  • Mark's Journal
  • DeXmas' Journal
  • Betable's Journal
  • parowoz's Journal
  • Topblast_'s Journal
  • CopperpotQ's Journal
  • japro's journal
  • Merlin3D Development Journal
  • SuperMaximo93's game development
  • Hect
  • Alberta online
  • DIEVOLUTION DevBlog
  • vodku's Journal
  • Codinguy's Journal
  • One man show
  • frang75's Journal
  • Calculemus's Journal
  • ConorJH's Journal
  • DaedalusK71's Journal
  • undead's programming corner
  • SubgateUniverseDevLog
  • Maciekp's Journal
  • Truxton's Journey into Game Development
  • -=cmaster.matso=-'s Journal
  • Not enought samples
  • Eigen's Journal
  • After Hours - and Then Some
  • Dylan's Journal
  • MelKay's Journal
  • Starpires - Space Strategy
  • StormJournal
  • QuestLore devblog
  • Journal of the Mini-Engine (ME)
  • Gl_Terminator's Journal
  • Terminal 0.1 Log 03
  • Odiee's Journal
  • Noisecrime's Journal
  • IMPACT Engine Development Blog
  • asm0day's Journal
  • YodamanJer's Journal
  • Learning Game Programming
  • The Beginning
  • GuardianResearch
  • Dumping Thoughts
  • lanemax's Journal
  • LaneMaxwell's Journal
  • IceFall Games
  • Ashnor's dev journal
  • moodywine's Journal
  • Thomas Amaranth's Journal
  • LoreHunter's Journal
  • VJ01's Journal
  • IronReaverGames Journal
  • OutlawZen's Journal
  • Xealgo's Tumblr Blog
  • Rich Markle's Journal
  • bigxow's Journal
  • Unity3D and AI Game Development
  • Project Updates
  • Lyost's Journal
  • AffenCode Blog
  • davispolk's Journal
  • LightSource Team's Journal
  • Midnight Thoughts
  • Subliminalman's Journal
  • AltairDali's Journal
  • NFL 2011 Talk
  • Valvatorezj's Development Journal
  • Silviu Andrei's Journal
  • Slaton's Journal
  • FlyingSpork's Journal
  • From AiGameDev's Secret Lab
  • FLeBlanc's Journal
  • sampad's Journal
  • Meh Entertainment
  • DeGod's Journal
  • dev.mind
  • ZEJOKER13's Journal
  • swiftcoding
  • paka3d's Journal
  • Lior Tal's Sandbox
  • The Forgotten Planet
  • Rav3nSt0rm's Journal
  • Litheon's Journal
  • ddn3 journal
  • Yacjys
  • I am a beginner and clueless.
  • Adventures in GameDev
  • Mallach's Dev Blog
  • mortalmarshy's Journal
  • Triax Bridge Command
  • EddyDownload's Journal
  • David Amador Journal
  • WorldAlpha.com DevBlog
  • DevDog82's Journal
  • Halley62373's Journal
  • pygame
  • Untitled zombie game
  • alwynd's Journal
  • Lucasnj's Journal
  • johnnycash's Journal
  • George Laskowsky's Journal
  • Eastfist Builds a Machine
  • Allar's Journal
  • irrationalistic's Journal
  • Bidimensional Dreams
  • Jeason's Journal
  • MikeDodgers' Journal
  • BrianTheProg's Journal
  • ZorgaGames Journal
  • Dreaming's Esoteric Teachings
  • compscialien's Journal
  • sythe's Journal
  • turbello's Journal
  • Xanthier's Journal
  • Flowers In Tears' Journal
  • Chris's Animation Blorg
  • Shaker25's Journal
  • SpeedRun's Journal
  • JetStone's Journal
  • sirkibble2's Journal
  • The Shadow Journals
  • Overm1nd's Journal
  • TommyForesd's Journal
  • LeonidValess' Journal
  • Black-Rook's Journal
  • My project blog
  • Mayley's Journal
  • Azure Acres
  • darc koder's Journal
  • Earthwalker's Journal
  • The Hitchhikers Guide to Video Game Production
  • LarryADaniel82's Journal
  • 2D Game Making, the Easy Way
  • DMFirmy's Development Blog
  • Giliam's Journal
  • Notes
  • The Curiously Recurring Gimlet Pattern
  • Zach's Development Journal
  • Dukandia
  • Under Development Law @ GDNet
  • #AltDevBlogADay
  • Digitalis Digoxin
  • Hedron Online Development
  • BlueStar03
  • Library of links to movies
  • SCForest's Journal
  • Heath's Journal
  • Malachor's Journal
  • Craftwork Games Blog
  • Behind the Scenes of Mirthwerx
  • omnomnom's RPG journal
  • Gaiiden's Journal
  • Overview Journal
  • Severed Infinity
  • Creating a Grand Strategy
  • Life at Demergo Studios
  • RADICAL HEROES: CRIMSON CITY CRISIS
  • Adam's Lair
  • Vilntus Entertainment
  • Lateral Creation's Journal
  • nodeg's learning journal
  • Eating The Elephant
  • Cbear's Dev Journal
  • The Siege Released
  • GDC 2012
  • ChezNoir
  • Journey Into Game Dev
  • Ya2's Journal
  • theNewb1e's Journal
  • Boreal's Dev Journal
  • www.Dubious-Games.co.uk
  • _Suezo_'s Journal
  • Lemon Treehouse
  • TechnoFlux
  • GrayMatters
  • Computational Contemplations
  • StarInc Android Development
  • Narf the Mouse's Journal
  • Antilia Development Journal
  • SpaceBeam development
  • Nocturnal Ferret
  • Tdawg30's Journal
  • Making the 'Rituals'
  • Timelines: Assault on America
  • Gunthera's Journal
  • Anthropocene: A Browser-Based Text RPG
  • AndreaTux's Journal
  • Rendering Is Fun
  • Emforce's Journal
  • _moagstar_'s Journal
  • Journey to Ironbane
  • Tipsy's Journal
  • Nick's Corner
  • Methods of A Madman
  • B O N E S' Journal
  • i-tech's Journal
  • Zul's Journal
  • kruncher's Journal
  • Misadventures in Game Making
  • WubWub Games
  • The Proverbial Bottom Rung
  • MidnightTangent's Journal
  • Bharath Raghavan's Journal
  • Stuff Games
  • From Pixel to Product
  • MissMarble's Journal
  • | dxCUDA | software development journal
  • Ralph McJournalstein
  • HorangiSoft
  • Flight of the Journal
  • Thekill473's Tinker Shop
  • Staring into the Moon
  • Mr Jones' Journal
  • BlackWingedGames' Journal
  • ChinaJoy CGDC 2012
  • A Weird Journal
  • necros devblog
  • CodeImp Game Developments
  • Face Punch Games Devblog
  • Sparked Studios Games
  • nighttime development
  • Coding In Transit
  • Journal
  • Kazuo5000's Journal
  • TMKCodes' Journal
  • miicchhii's Journal
  • Framework Philosophies
  • Journal of the Burning Hand
  • Warbringers - hotseat pvp game
  • Tyberthia Learning Experience
  • 2D MO Game
  • SIC Games' Journal
  • RATED-RKOFRANKLIN's Journal
  • Severin's Journal
  • lwm's Roa Journal
  • n00b0dy's Journal
  • uwi2k2 - Part Time Game Dev
  • Bluefirehawk's: "Path to World Domination"
  • Project Veritas - Working title
  • An Engine Through Time and Space
  • Epic Zombie's Journal
  • Bon Ink Creations' Journal
  • Aeronel's Journal
  • My Journey
  • vee's game development blog
  • The Long Road of Simulation
  • TestRoom
  • Amateuriffic
  • Alex Hopkins' Journal
  • Game Project #1
  • Project NN
  • Hostile Viking Studio Development
  • First game for Android
  • Jonathan's Journal
  • The Dwarfenheim Journal
  • codingnoobie's Journal
  • Will push pixels for food
  • Funstorm Dev Blog
  • Synchrex Studios Dev Blog
  • Tales of Allula: Crystal Spirits Development
  • Realm Chronicles developer's blog
  • dmdSpirit's Journal
  • Empyrios: Prophecy of Flame
  • Horizon Dev Journal
  • Corey Hoard's Journal
  • Freya's Journal
  • Hannah Wood's Producer Journal
  • Aurioch's Time Machine
  • achild's Journal
  • Retro Grade
  • Little Sticky Destroyer
  • C# Workshop - Some reedits.
  • creatures-of-gaia.com
  • Adventure Through Game Programming and Development
  • ellisvlad's MMORPG Development Journal
  • FantasyCraft's Game Engine Development
  • The life of a Unity Developer
  • My First Journal
  • Alex.SilR's Journal
  • Nathan's Blog
  • theartist493's Journal
  • Black's Tales
  • Fran Bow, a point & click adventure
  • Aaru's Journal
  • Drayan's TechBlog
  • Journal.Unknown
  • Josh Hartley's Journal
  • A long, frozen Path
  • Game Dev: P-13
  • Gianmarco Leone - Audio Director
  • slicer4ever's Journal
  • The Tribes Game Dev Journey
  • Like tears in the rain
  • Undead Castle Dev Journal
  • Welcome to Flying Cow Ink
  • Riphath's Journal
  • sgt_barnes' Journal
  • Voxel Game's
  • Xamusel's Gamedev Journal
  • Legends of Maelm
  • Crunch Magic
  • The Gameconomist
  • Kaptein's Journal
  • Morphex's Journal
  • Cafe Murder Dev Log
  • XNA 3D hexagon tile RPG testing
  • Modern Roguelike
  • Luis Krestos IOS
  • Gamieon's Journal
  • Koron
  • Sports Fiction ® New Sci-Fi Sports Game Project
  • cengizonkal's Journal
  • Minecraft/Survivalcraft Text Based Game
  • MrPhoenix's Dark Galaxy RPG
  • Vaerydian
  • j-jorge's Journal
  • Progress of 2D (?) Game
  • Orcus3D - The development of a modern game engine
  • Solo Game Developer Guy
  • Terrifying Secrets
  • Ground Up: A Journal Of An Engine
  • 1520:The Asylum
  • Electronic Meteor
  • Cthuga's Journal
  • ikam's Journal
  • Making a simple dungeon crawler
  • Digitopia's Journal
  • Ghostship Journal
  • Marc Mencher's Career Advice
  • Zombie Factory Dev Journal
  • Colony - Indiegame Dev Journal
  • Christian24's Journal
  • Joe's Games
  • MateiSoft's Journal
  • Tubocass' Journal
  • EWClay's Journal
  • And let there be light.
  • Starbase Citadel
  • arunDev's Journal
  • redw0lf's Journal
  • BGBTech: The Status Update
  • The Dawn Age - Development Journal
  • Fen's Journal
  • Jcam Engine 2 Development
  • More Than Cannons Announcement
  • chamomoe's Journal
  • Evolving as a programmer starting with Pong
  • scottrick49's Journal
  • Leadwerks Developer Blog
  • From idea to a game.
  • Game for kids
  • Azaral's Rants, Raves, and Lunatic Ideas
  • Krealit's Journal
  • Scarabus' Journal
  • Journey Into Functional Programming
  • The Beginner's Programmicon
  • Project Domini
  • fps games by mohammed 360
  • Infinity Elephant Development Journal
  • Making a Terrain Generator
  • Squared'D's Journal
  • Squire Studios: A Team of First-Timers!
  • AllEightUp's Journal
  • My attempt at making a platfo... no, a game
  • Spacetime Perpetuance
  • Multiplayer Project Journal
  • PokingWater's Journal
  • Creating A Game: My Journey
  • Konrad's Journal
  • Sam Jackson's World of Game Development
  • Miscellaneous Programming Notebook
  • Somewhere in space
  • Le Journal de Yahiko
  • TidBitCode
  • Nightmaare Shares
  • Dev notes from the Crypt!!!1eleven
  • Neometron's Journal
  • Snapey Code
  • Morikubo's Journal
  • Game A Week Self Challenge
  • DareDeveloper's Journal
  • Aura Games' Journal
  • Viadukt Dev-Journal
  • Arhim's Journal
  • DOT Space Hero's Journal
  • Building a browser game.
  • IcedCrow's Dev Journal
  • BigGiantHead's Journal
  • Richards Software Ramblings
  • Mikkel Staunsholm
  • The Wood under the Moon
  • ErihLee's Journal
  • Dialock's Journal
  • Meatsack's Workshop Journal
  • LouisMed's Journal
  • UncleVlad29's Journal
  • Hands On GameMaker:Studio
  • Project StickandCarrot
  • Casey Hardman's Journal
  • The SeaVax Journal
  • Howligan's Journal
  • Better Than Accounting
  • Death rays and scrapyards
  • Jsvcycling's Journal
  • Vilem Otte's Journal
  • Fight Club Games
  • TOT to Unity3D
  • LemCoop Development Journal
  • Dog Days Dev
  • The Journey of Taking Over Someone Else's Project
  • Gamedev info
  • Caveman
  • Project Z
  • A different way
  • Big Boss TV
  • Sunchasers development diary.
  • The Great Emoticon
  • Nothing Journal
  • Arkanong development blog
  • Building OllieBit
  • Kveitosphier -- Angelic Series (092113)
  • The Adventures of Mr. Fluffypants and Galaxy Lad
  • EraEngine
  • BallShooter Dev.
  • slayemin's Journal
  • Shane C's Journal
  • 2DFriends
  • PanPan's Journal
  • 2d Game Creation
  • #GameDevIsWayMoreFun
  • Grand Strategy: Space War
  • mabulous techblog
  • Mippy's Beehive
  • The development of Voxel
  • Return of Spy Ghost Raider
  • Wunderpong
  • Living and working in Russia
  • Dumont's Journal
  • reenigne's Journal
  • The coming Onslaught
  • Too dumb to make it, too dumb to quit.
  • The Development Blog of Neuton Mouse
  • Brass Watch Games Development
  • Sky Battles - Follow the evolution
  • Kornner Studios
  • The Dev Journal
  • N.I.B.'s Journal
  • jph's itreationGAMES development journal
  • csliva's Journal
  • Ilya Suzdalnitski's Journal
  • Project North Dev Journal.
  • Pete's Journal
  • A Youngster's Development Journal
  • [Theoretical] Games that evolve from player input
  • NerdSushi's Journal
  • Only if [Beta] - Surreal Puzzle Game
  • Never Miss: Dev Journal
  • My SDL Adventure
  • montify's Journal
  • Battle City
  • The Seven Tides
  • Latte Deconstruction - A classic 2D platform game deconstructible
  • SeaCraft! – game development journal
  • exOfde's Journal
  • Nyphoon's Thrilling Quest for Release and Everything In-Between
  • Tutorial Doctor's Journal
  • Path Tracing Adventures
  • ferrous' Journal
  • Alex's Journey Through Game Development
  • Exploring, learning and failing
  • arka80's Journal
  • J Fixby
  • GrinnTech's Notes
  • Spectra - First Game Creation
  • Fortification Hills Studios
  • QuickSilverCarpet's Journal
  • Flappy Assassin is now available
  • Animated Skinned Meshes
  • Undergroundies Projects
  • From End to Beginning
  • ShadowKind Games DevLog
  • Code Snippets
  • The Inner Circle
  • EveronWorlds Ew FPS Online
  • bradleycooper11's Journal
  • The Journeycat's Handbook
  • russelvedcse's Journal
  • MadRockGames
  • Sergioni's Journal
  • Pixel Perfect blog
  • MacAfeeje's Eludiant Time:Starlit
  • Smeagol's Journal
  • chel's Journal
  • Flared Development Journal
  • Malkavian Assembly's Journal
  • OLD Lactose!'s Journal
  • Alurik's Journal
  • Dreaming of adventure
  • Jsvcycling's Tower Defense DevBlog
  • Truerror's Journey Through Insanity
  • Jordan Bonser's Indie Dev Journal
  • afraidofdark's Journal
  • Journal Ov Azathotep
  • Fallen Shadows
  • GTRACE
  • deadstip's Journal
  • showtime
  • Edward's Journal
  • LOST ORBIT Development
  • Raven_rs Journal
  • PNGs and Things
  • Ding! Games
  • ZeroBeat's Journal
  • Coding with OpenGL
  • Joe Gilliver - Black Shuck Audio Journal
  • Giallanon's Journal
  • Project Root
  • delagames' Journal
  • Saint Retro's Journal
  • Arch1eN's GameDev Adventures
  • Return of the Dodo's
  • Riuthamus's Freelance
  • lalilulelost's Journal
  • newtechnology's Journal
  • normoyle1993's Journal
  • Kiritsu Games
  • LariGuilger's Journal
  • Creating Spacemasters
  • Hedeic's Journal
  • dustArtemis ECS Framework
  • IKazma: The Development & Experience
  • SelenaMiller's Journal
  • Project Anera
  • Daath Galaxy Devlog
  • Exploring Programming
  • Wombat Hole
  • GoCatGo's Development Journal
  • JumpSmash Legend a 3D Badminton Simulation Mobile Game
  • The Cuboid Zone
  • Avengers UTD Chronicles
  • Xylvan's Journal
  • Jean-François Fortin's Journal
  • Parallel Development Log
  • Gregory's Development Journal
  • SynchingFeeling's Journal
  • FinalXIIISora's Journal
  • The Big Procedural Game Journal
  • GiTS' Journal
  • Sporniket's log - Game programming while having a busy life
  • 2Play's Developer Journal
  • Garrett Hoofman's Journal
  • Island Troll Tribes
  • int main
  • cyberspace009's Journal
  • Impossibru is nothing!
  • NineheadGenesha's Journal
  • Inside a Wicked Lair
  • Final´s Game-Dev
  • Stett's Journal
  • Madolite's Journal
  • My Game"The Alien On The Planet"
  • How to make a clone of Futile Tiles
  • A Dreamer's Notebook
  • AfricanThunder's Journal
  • Arikin's Journal
  • Sinvas_K's Journal
  • Procedural Worlds
  • Binary Cats
  • Burnt Dragon's Journal
  • Washu's Journal
  • imoogiBG's Journal
  • Eck's Journal - Still Flying
  • Thaumaturge's Journal
  • ryan20fun's Journal of Rasterisation
  • Xaer0's Journal
  • The Week of Awesome II
  • The week of awesome II - shadowisadog
  • 0sok's Journal
  • Making of: Acclimate Engine
  • Misantes' Journal
  • The Week of Awesome II Herd of Nerd Star Participation
  • New Syntax blog for Week-of-Awesome-II
  • Captain Coffee's Journal
  • WoA II Journal
  • Jack & Francis's Week Of Awesome II
  • Erik Rufelt's Journal
  • Week of Awesome II
  • Xai's Awesome Living Toys
  • Week of Awesome II dev journal
  • WoA - My first gamejam
  • The Last Toy in the Toy Box
  • Extremely Usefull Bits
  • GeoffreyS' Journal
  • Jurassic Park Aftermath
  • Project PX
  • H.A.C.K. - Development Journal
  • ajm113's Journal
  • LV-341B
  • Archmage Rises
  • Stormynature's Miscellanea
  • Hierarchical subdivision
  • Radiant Engine Development
  • "Barricade"
  • New New Things
  • Librexus
  • mtlk's Journal
  • EmpiresInRuins' TD Journal
  • Collectible Card Game + Commercial Sim = Awesome
  • Legend of Grimrock 2 Review
  • Dr.John's Journal
  • Gorogorosama vs GameDev
  • Ironbane Devlog #1
  • Game News
  • PowerShell Games
  • ODMO - puzzle game - android release
  • Gaiiden's Journal^2
  • Gaiiden's Journal
  • Gaiiden's Journal
  • Debugging Diaries
  • General Thoughts
  • Captain's Log
  • Orangepixel's Journal
  • LAURENT*'s Journal
  • the game
  • fakhirs's Journal
  • A sound guy making a game.
  • Sisofys' Journal
  • Browser Scent
  • AuroraRL
  • Manager of Hell
  • Tales from the Engine's Core
  • Nemo Persona
  • victoriaadams02's Journal
  • Rico's Development Log
  • Funky Monkey Studios Dev Blog (French)
  • Fear the Light: The Path to Playable
  • Astari
  • mousetails RPG
  • Developing a JRPG
  • goldmoelly's Journal
  • Goblin War
  • Phaetonium's Journal
  • Flame
  • Reactor Engine
  • Boardspace.net Game AI Journal
  • TheComet's Journal
  • Negazina and his shenanigans
  • Realm Crawler Development Journal
  • Becoming an indie
  • The Wizards Blog
  • SIMSpace 8.0
  • Educating an artist
  • Michael Staud's Journal
  • YanimStudio's Journal
  • Adventures into Unreal Engine & indie dev
  • GamzTV
  • Blacksea Odyssey Devlog
  • The Furious Ape Journal
  • Feras' Journal
  • SnailLife
  • Ray Tracing Devlog
  • hgoel0974's Journal
  • GameGeezer's Journal
  • Pavloid game
  • cozzie's Journal
  • Han''s Quest Journal
  • Lost Repo
  • DevBlog: Wolves at the Door
  • victorx's Journal
  • TheChubu's Journal
  • Mobile Game Dev Journal
  • Protheus Engine
  • ducanhtuvu's Journal
  • YGGDRASIL STUDIO's Journal
  • Skinned Mesh/Skeletal Animation Editor in D3D11
  • Proceedings of TheUnimake
  • Inko makes Prototypes
  • Caldera Games' Journal
  • Machine Made
  • YAAG
  • Xam'n'Eggs
  • Developer Journal
  • Game Tale
  • Jygle's Journal
  • Sol-Ark's developer journal
  • Blender - skinned meshes and animation DirectX export
  • Night Lone Engine: Journal and progress
  • Vortex Game Studios
  • williamssara005's Journal
  • Onigiri Flash's Journal
  • The Week of Awesome III
  • Simmie's Journal
  • The Dark Prognosticus
  • Game explorations
  • Danmaku no Kyojin
  • Epicelitedude's Journal
  • Thinking about treasure lately
  • IYP's Graphics Journal
  • My Stuff
  • Trades with Spirals Development
  • WoA 3 (2015)
  • Seven Spells Of Destruction Development Journal
  • Battleships Development
  • An arcade console developer's Journal
  • Spidi, Magic Item Tech Journal
  • Galactic Adventures
  • Week of Awsome III journal
  • TeamTeamEric's Journal
  • From The Forth Dev journal
  • Speed's Progress
  • Gooey's Journal
  • Week of Awesome III
  • ArThor's Journal
  • hu3 team - WoA III
  • Inside the blizzard
  • JamCats' Week Of Awesome III
  • Our Week of Awesome Project
  • Lich Dev Log
  • Single-Handed Game Dev
  • GTEntertainment's Journal
  • Soulwielder Dev Journal (Week of Awesome III)
  • MarioLuigiMan's Journal
  • WoA3 - Still Flying
  • Calinabris' Journal
  • DKoding's Journal - Koding Nights
  • alexokita's Journal
  • TBFC's Week Of Awesome III Dev Journal
  • My First Game !!
  • Dusters Devblog
  • Bigdog57's Journal
  • ????? ???????? ????? ?????? 01283377353 + 35710008 ???? ????? ????? ????????
  • El Tomba - Developer Diary
  • Starshard Dev Journal
  • alexmasen's Journal
  • bobbentz's Journal
  • Merc Tactics
  • WatsonTBK's Journal
  • Spiral Lords: Armada
  • Arms of Telos
  • Really Slick Blog
  • c++ SFML TEAL
  • A random Game
  • Creation of Zergification tech demo
  • Opiniocracy
  • Kill All Demons!
  • Moon Pub Games
  • KruSuPhy's Journal
  • KruSuPhy's Journal
  • Final Year
  • Monster Chronicles: Mobile Strategy RPG
  • Shinylane's OpenGL Journal
  • psychedelia smith's Journal
  • Conkoon's Journal
  • GE2015's Journal
  • We the Innovation
  • Engine development for fun and bachelors thesis
  • Farom Studio
  • Geometer's Apprentice
  • NavWorkshop
  • an unnamed youtube simulator
  • Eck's Star Citizen Efforts
  • Project Gift
  • opmania35's Journal
  • Westorm's Journal
  • What I did
  • Short rules for beginners in game dev
  • DEV - War of Kingdoms Pocket
  • MoonKiteTree's Journal
  • Tinus Tate's Journal
  • Fowl Flying
  • Memorial Trees: forget-me-not Journal
  • Fidelum Games
  • Hexmind's Journal
  • MVG Interactive
  • EXODUS - A New Age Dawns
  • OmnicidalStudios Akintoo Journal
  • Kingpin
  • iMini Development
  • Oblivion Wars Development Journal
  • devlion's Journal
  • 2D Platformer
  • Cleemo's Journal
  • Becoming the Lord of Dwarves
  • Rogue555's Journal
  • Not Yet Implemented
  • Prali Games
  • Multiplayer RPG dev diary
  • Venatus
  • AVaW2015's Journal
  • Faison92's Journal
  • ProcGen Journal
  • Sector0's Journal
  • P2p online's Journal
  • One Piece Ultimate War
  • Syrena's Journal
  • w32's Journal
  • Max-Green's Journal
  • [GBA] Kingdom of Twilight a retro rom
  • Gamescrye's Game Design Blog
  • GameDev.net Partners
  • Blend4Web Development Journal
  • STAR SHIFT
  • Sweat, tears and blood
  • Amanda/adamSnowflake's Journal
  • Unity Parkour Game
  • Lawnjelly's Journal
  • ProcFxGen's Journal
  • dpadam450's Journal
  • Sungazer Software Development Log
  • A New Developer's Journey
  • De Feet - a 3D interactive story RPG
  • V0xel Sp4ce Development
  • yoshi_t's Journal
  • Strategy Empire's Journal
  • VikingVRStudio's Journal
  • Towards The Pantheon Devlogs
  • GameArch
  • SilviuShaders' WoA Dev Journal
  • Frango Digital Log - The Week of Awesome IV
  • AlienCore's Journal
  • Mousetails WoA 4 journal
  • Mind of Khan
  • XycsoscyX's Journal
  • The Week of Awesome IV
  • WOA 2016 | Team Bytetroll
  • EarthBanana's Journal
  • GameDev.net Staff Blog
  • Unnamed Turn-Based Strategy
  • "Popular" progress.
  • 3D, AI, procedural generation and black jack
  • Avalander's Journal
  • Andrey Macritskiy
  • Drone Combat Devlog
  • Rog Games' Journal
  • The Xoid Isometric Survival... from the start
  • Journal of Gruffler
  • Project Tidalwave
  • Ultra Kai's Graphics Journal
  • MY FIRST INDIE GAME! :D
  • DoomedGaming
  • V-Play Cross-Platform Game Engine
  • Bacterius' WoA Feedback
  • Project Mistwrapped
  • Game Development Adventures
  • The Achilles Journal
  • The Cptn's first voyage
  • A short Journey over Zeno's Bridge
  • MagForceSeven's Journal
  • TheCaptainSly's Journal
  • School and Mazes
  • Development of My Own Civilization
  • Richie2Pixel's Journal
  • khaniiuc's Journal
  • saadtaame's Journal
  • First Complete Game
  • Turn-based strategy about agriculture
  • Systemic Games
  • anyone needs a 3d modeller?
  • Vidar DevBlog
  • Vertexwahn's Journal
  • Opportunities in AR/VR
  • AngleWyrm Studios
  • "Project SpeceVille" Developer Journal
  • Floatlands devblog
  • Game Creation Journal: Midievalry
  • Arceneaux's Log
  • ViciousGaming's Journal
  • ACE Team's Journal
  • yps_sps' Journal
  • Alchemist
  • Project Life
  • GrindQuest
  • Paninairo's Journal
  • JacPete's Super Mage World
  • Resilients Journey
  • Who is Who? Dev blog
  • Multiverse: Cosmic Conquest TCG Development Journal
  • Aggroblakh's Journal
  • Fight the ADHD
  • The Time Rider Community Journal
  • Too few shopkeeper games!
  • VFX Highlights & Games
  • lougv22's Journal
  • First Impact: Rise of a Hero's Journal
  • Labraid's Journal
  • BattleForte Game DevLog
  • WinterDragon Says Print("hello")
  • Ascension Game Journal
  • bogosaur's great journal of wisdom.
  • AurumDust journal
  • Progress on The Last Score
  • BrykuTheDev's Journal
  • Developing a good looking story to make it a game
  • Rebirth of a classic card game
  • Ships vs Sea Monsters. From sketches to final edition
  • SquaserZ - The Devlog
  • Dev Quest With AriiMoose
  • ohoyy056's Journal
  • TheLastKind's Journal
  • ohoyy070's Journal
  • essaywriting
  • Idea To A Game
  • XyraniaDev's journal
  • ohoyy082's Journal
  • Pirate Dawn Universe
  • Deep Waters Devblog
  • brigittepetrie's Journal
  • GoldbarGames' Journal
  • Kickstarter/Greenlight Dev Journals/Tips/Insights
  • Delphinity
  • Big List of Mobile Game Reviews [UPDATED DAILY]
  • 0day's Blog
  • DuelingDevblogs
  • Jaden's Blog
  • Tee_Hunter
  • GDC 2017
  • Voxelaxy
  • Power Pong Devblog
  • Spinbot's Blog
  • SerikASA's Blog
  • Brewing the tee
  • Johnnymorgan's Blog
  • Blog #1 - You can't push a rope!
  • Korvas' Game Dev
  • Tough Story Volume I - Big Hell
  • VirtualRN's Blog
  • Game Blog
  • Dadou666's Blog
  • SHIRO Developers Log
  • Star Heritage
  • Bluword
  • Appodeal Blog
  • juegostudios
  • saraedward's Blog
  • shirawinget's Blog
  • Baro's Beginning
  • phil67rpg's Blog
  • Video Game Sound by Olivier Girardot
  • Deep Worked Blog
  • Swim Out
  • Bypassed - DevBlog
  • Muisca's Blog
  • AlexHoratio's Blog
  • Hell Warders
  • hydra1's Krypton Development Team
  • tommorow's Blog
  • ¿How to do Game?
  • My 1st GDC: Recap
  • Beyonce's Blog
  • donislawdev's Blog
  • Creating Complexity
  • dovodi's Blog
  • Stitched Showcase
  • itSeez3D Avatar SDK
  • 40Ggames' Blog
  • GamerX1221's Blog
  • HunterGaming
  • Nicolas Bertoa's Blog
  • Masters VR
  • PiN
  • Ben's Appallingly Humble Blog
  • Starfall Tactics
  • Ermergerd Ent's Blog
  • Secure Vend LLC's Blog
  • Cascapadia
  • Last Regiment Dev Blog
  • sarwar's Blog
  • Spaceguard 80
  • appguruz's Blog
  • ios\Android games promotions!
  • Forgiveness devblog
  • The creative industries digital game.
  • xboxoneya's Blog
  • Untitled: My journey with LibGDX and bullet hell
  • Block Builder Update Blog
  • noisechip's Blog
  • Call of Avatar
  • behc's Blog
  • Terrible Mess Games
  • polyfrag's Blog
  • polyfrag's Blog
  • Dr. Lexus Blog
  • Jungle Tag by The Kid Can Drive
  • polyfrag's Blog
  • Wormhole Devlog
  • Age of Dark
  • Trym Studios' Concept Blog
  • PSG's Blog
  • sinopgames
  • Space Warfare Blog
  • EdenAeternum's Blog
  • APPTUTTi's Blog
  • SlammaJammaMovie's Blog
  • Village Monsters Dev Diary
  • Rox087's Blog
  • THEDARKMEME's Blog
  • Progorion's Blog
  • lexnewgate's Blog
  • Starminer7Z7 of Fullpower's Blog
  • Progorion's Blog
  • DualTD
  • OandO's Blog
  • From UltDip to ...
  • io games
  • .io Games
  • JohnTheRipper88's Insight and Ramblings
  • Moosehunt
  • VBexEngine
  • Games Development Notes
  • Eart - a similar to an rpg but with typical elements of a bullet hell games
  • /~ 카톡 kk4678 ~/ 경주 출장안마-경주 출장만남-경주 출장마사지-경주 출장서비스/~ 카톡 kk4678 ~/
  • Valley of Crescent Mountain
  • Charly Men's BIZARRE
  • 울산오피 ○1○《⑻⑼⑷⑺)⑥⑥④⑧ 세계일등클래스
  • 청담안마 OlO⇔2816⇔2526 〃최저가 청담안마방 청담역안마 청담안마시술소 청담안마추천 청담역안마가격 청담안마위치 청담동안마방 청담동안마추천 청담안마예약
  • 인천출장샵
  • ⅸ강원도출장샵 阝카톡gg882출장콜걸.홈피 kiss45.COM출장안마/ 출장마사지/출장샵/출장업소/콜걸연락처/섹파/콜걸아가씨카톡/업소연락처.
  • Michael Zhou
  • が대구출장샵阝카톡gg882출장콜걸.홈피 kiss45.COM출장안마/ 출장마사지/출장샵/출장업소/콜걸연락처/섹파/콜걸아가씨카톡/업소연락처.
  • Battle of Millenia Update #1
  • ⅸ아산출장샵 阝카톡gg882출장콜걸.홈피 kiss45.COM출장안마/ 출장마사지/출장샵/출장업소/콜걸연락처/섹파/콜걸아가씨카톡/업소연락처.
  • A Passive Gamer's Blog
  • Newbie Gamer
  • Android, the most popular mobile platform throughout the world these days
  • Aggressive Gaming
  • 경마사이트추천 ⟡->『 AA77.ME 』<-⟡인터넷경마사이트
  • The Yii Development Framework for fast, extremely professional performance
  • Psychology in game design
  • Check out my Game!
  • Hell Warders Development blog
  • Wildlife control service
  • EP (A Platform Game)
  • Outentiq
  • See Gee Eye
  • Jenny's Magical Adventure
  • Last Hills Teaser Trailer (Horror Game) - Red Projekt -
  • Want to help make a game
  • New Game - ArcAngel is released.
  • Corona Labs Blog
  • Java&Python game development
  • How to write outstanding game reviews
  • Exactly how Does the Euromillions Millionaire Raffle Work?
  • puppysss
  • World Game Info
  • Rick Henderson And The Artifact Of Gods
  • Mobile Application Development Today
  • Runica: The Ancient Dungeon
  • Benefits of Mobile Application Development
  • Enterprise App Development you need to know
  • Mobile Application Development
  • krkrgames
  • My First Success - Dev Blog
  • Alchemica
  • Elemento : Development Blog
  • Remote Jobseekers

Found 1250 results

  1. Hi, I tried searching for this but either I failed or couldn't find anything. I know there's D11/D12 interop and there are extensions for GL/D11 (though not very efficient). I was wondering if there's any Vulkan/D11 or Vulkan/D12 interop? Thanks!
  2. Hi, I have a surface mesh and I want to use a cone to cut a hole on the surface mesh. Anybody know a fast method to calculate the intersected boundary of these two geometries? Thanks. YL
  3. Hi Guys, I am just wondering if it is possible to acquire the address of the backbuffer if an API (based on DX11) only exposes the 'device' and 'context' pointers? Any advice would be greatly appreciated
  4. bool InitDirect3D::Init() { if (!D3DApp::Init()) { return false; } //Additional Initialization //Disable Alt+Enter Fullscreen Toggle shortkey IDXGIFactory* factory; CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void**>(&factory)); factory->MakeWindowAssociation(mhWindow, DXGI_MWA_NO_WINDOW_CHANGES); factory->Release(); return true; } As stated on the title and displayed on the code above, regardless of it Alt+Enter still takes effect... I recall something from the book during the swapChain creation, where in order to create it one has to use the same factory used to create the ID3D11Device, therefore I tested and indeed using that same factory indeed it work. How is that one particular factory related to my window and how come the MakeWindowAssociation won't take effect with a newly created factory? Also what's even the point of being able to create this Factories if they won't work,?(except from that one associated with the ID3D11Device)
  5. Good time of the day, members of the forum! I do not think that many have tried themselves in the development under Hololens, but nevertheless decided to write. In any case, all work with Hololens is reduced to UWP and DirectX 11. So I wrote a small prototype for easy initialization of primitives, etc. In the scene, and began testing on the piece of iron ... And I was very upset by the performance tests. A short excursion, for those who are not in the subject: - the construction of an image under Hololens, naturally a stereo image for this reason I use DrawInstanced with pre-prepared shaders. Shaders are very simple, conversion to world coordinates and projection of the species, color is set straight in the shader. Plus to switch the render in 2D Texture Arrays I use the geometry shader, that's basically all. For the test, I generated a grid of 10k - 30k and output them about 10 times ... for 10k grid and 10 calls - 30fps, for the last about 18 - 20fps. Sadness, I thought, and I decided that my hands are not growing in size and my brain does not want to work anymore ... I decided to look for flaws in my shit ... I measured the time for drawing 10 calls - about 800 ticks, it's kind of not that bad. Slightly optimized the sorting by materials, namely, switching between shaders minimized but in the loop there were updates of constant values for the shader namely transform for each object. Fps grew by 2-3 but the time to render the frame did not measure ... Although Unity seems to hold the bar 1.2 - 1.3 mm triangles at 10-15 fps ... I myself did not check the word for people. So, maybe someone can decide what can be crooked and what can be patched up ... P.S. The buffer of depth is 16 bit, and I use similar indices. Thank you in advance.
  6. This header is mentioned in the book I'm reading but there is no documentation on msdn... Is it like an... outdated and abandoned header? If so, what's the current default/recomended library for handling errors with directX?
  7. Can anyone recommend a wrapper for Direct3D 11 that is similarly simple to use as SFML? I don't need all the image formats etc. BUT I want a simple way to open a window, allocate a texture, buffer, shader.
  8. Q1: Since there is no more fixed pipeline rendering in DX11, for every part of rendering in DX11, do I need to create a brand-new vertex shader and pixel shader... or at least I have to find one relevant online. If you work on skinned meshes and other effects originally worked in DX9 fixed pipeline, do I have to rework everything by now? Q2: For assimp, if it originally was designed for DX9, like it is coupled to a DX9 device for creating meshes and materials etc. Do I have to add in the DX11 device in the assimp, or can I just leave the assimp to remain in DX9 and after the meshes are loaded, I just convert the vertex buffers and index buffers into DX11 buffers? Thanks Jack
  9. Hello, I have been fighting for sometime now with exporting animations from Maya to my own engine using DirectX 11. I export the fbx file with all its content in it. So the problem i have is that the animation dosnt seem to rotate the joints correctly? Please see the attached screenshots. bindpose.png = Frame 1 (first keyframe is at frame 2), the bindpose, no animation applied. frame30.png = Frame 30, rotation applied to two joints. engine.png = Frame 30 of animation in engine, rotation != rotation in Maya I use my custom tool to export data from the fbx file using the fbx sdk. The following is how i extract the skeleton bind pose and inverse bind pose transforms using fbx sdk: (Note: freeze transformation have been applied to the mesh, so i ignore the geometry transform since its just an identity) FbxAMatrix localTransform = p_Node->EvaluateLocalTransform(); joint->m_Location = localTransform.GetT(); joint->m_Scale = localTransform.GetS(); joint->m_Rotation = localTransform.GetQ(); FbxAMatrix inverseBindTransform = p_Node->EvaluateGlobalTransform().Inverse(); joint->m_InverseLocation = inverseBindTransform.GetT(); joint->m_InverseScale = inverseBindTransform.GetS(); joint->m_InverseRotation = inverseBindTransform.GetQ(); Then i extract information about each join for all keyframes, in this example i only sample rotation: for( int i=0; i<rotationCurve->KeyGetCount(); ++i ) { FbxAnimCurveKey key = rotationCurve->KeyGet( i ); FbxTime time = key.GetTime(); FbxAMatrix transform = p_Node->EvaluateLocalTransform( time ); // setup frame JointFrame frame; frame.m_IsRotation = true; frame.m_Frame = time.GetFrameCount( m_AnimFramerate ); frame.m_Rotation = transform.GetQ(); joint->m_RotationKeyframes.add( frame ); } When i look at the rotation values from Maya i see that sometimes the axis of the quaternion is 0,0,0 assuming that the axis is mData[0-2]. So i must be doing something wrong here right? Thats the fbx part. Then in my engine i load the resources. This is how i setup and update the skeleton transforms: (Note: m_Rotation is a quaternion) void pmJoint::computeMatrices( pmJoint * p_Parent ) { if( m_IsDirty ) { pmMath::matrixCreateTransform( &m_LocalTransform, m_Location, m_Scale, m_Rotation ); } if( p_Parent ) { if( p_Parent->m_IsDirty || m_IsDirty ) { m_WorldTransform = m_LocalTransform * p_Parent->m_WorldTransform; m_IsDirty = true; } } else if( m_IsDirty ) { m_WorldTransform = m_LocalTransform; } for( pmUInt32 i=0; i<m_Children.count(); ++i ) { m_Children[ i ]->computeMatrices( this ); } } So as you can see, all bones operate in their localspace using their parents world to update their world. Then to get the render matrices i call this function: void pmJoint::computeRenderMatrices() { m_RenderTransform = m_InversBindTransform * m_WorldTransform; for( pmUInt32 i=0; i<m_Children.count(); ++i ) { m_Children[ i ]->computeRenderMatrices(); } } The animation part is simply lerping and slerping. I get the problem no matter if i interpolate or just show keyframe poses, so i left that code out. Any input, idea or crazy thought is welcome. Im at a loss here.
  10. My ultimate goal is to decouple the whole thing from the DXUT library... What I see in this test app is a patch of flashy blue object, could be the mesh itself. Could anyone please shed some lights on this? Thanks Jack enum DEVICECONTEXT_TYPE { DEVICECONTEXT_IMMEDIATE, // Traditional rendering, one thread, immediate device context DEVICECONTEXT_ST_DEFERRED_PER_SCENE, // One thread, multiple deferred device contexts, one per scene DEVICECONTEXT_MT_DEFERRED_PER_SCENE, // Multiple threads, one per scene, each with one deferred device context DEVICECONTEXT_ST_DEFERRED_PER_CHUNK, // One thread, multiple deferred device contexts, one per physical processor DEVICECONTEXT_MT_DEFERRED_PER_CHUNK, // Multiple threads, one per physical processor, each with one deferred device context }; DEVICECONTEXT_TYPE g_iDeviceContextType = DEVICECONTEXT_IMMEDIATE; // The vertex for a corner of the mirror quad. Only the Position is used. // The others are so we can use the same vertex shader as the main scene struct MirrorVertex { D3DXVECTOR3 Position; D3DXVECTOR3 Normal; D3DXVECTOR2 Texcoord; D3DXVECTOR3 Tangent; }; typedef MirrorVertex MirrorRect[4]; // By convention, the first n lights are shadow casting, and the rest just illuminate. const int g_iNumLights = 4; const int g_iNumShadows = 1; const int g_iNumMirrors = 4; // The different types of job in the per-chunk work queues enum WorkQueueEntryType { WORK_QUEUE_ENTRY_TYPE_SETUP, WORK_QUEUE_ENTRY_TYPE_CHUNK, WORK_QUEUE_ENTRY_TYPE_FINALIZE, WORK_QUEUE_ENTRY_TYPE_COUNT }; // The contents of the work queues depend on the job type... struct WorkQueueEntryBase { WorkQueueEntryType m_iType; }; // Work item params for scene setup struct WorkQueueEntrySetup : public WorkQueueEntryBase { const SceneParamsStatic* m_pSceneParamsStatic; SceneParamsDynamic m_SceneParamsDynamic; }; // Work item params for chunk render struct WorkQueueEntryChunk : public WorkQueueEntryBase { int m_iMesh; }; // Work item params for scene finalize struct WorkQueueEntryFinalize : public WorkQueueEntryBase { }; // The work item queue for each per-chunk worker thread const int g_iSceneQueueSizeInBytes = 16 * 1024; typedef BYTE ChunkQueue[g_iSceneQueueSizeInBytes]; //-------------------------------------------------------------------------------------- // Constant buffers //-------------------------------------------------------------------------------------- struct CB_VS_PER_OBJECT { D3DXMATRIX m_mWorld; }; UINT g_iCBVSPerObjectBind = 0; struct CB_VS_PER_SCENE { D3DXMATRIX m_mViewProj; }; UINT g_iCBVSPerSceneBind = 1; struct CB_PS_PER_OBJECT { D3DXVECTOR4 m_vObjectColor; }; UINT g_iCBPSPerObjectBind = 0; struct CB_PS_PER_LIGHT { struct LightDataStruct { D3DXMATRIX m_mLightViewProj; D3DXVECTOR4 m_vLightPos; D3DXVECTOR4 m_vLightDir; D3DXVECTOR4 m_vLightColor; D3DXVECTOR4 m_vFalloffs; // x = dist end, y = dist range, z = cos angle end, w = cos range } m_LightData[g_iNumLights]; }; UINT g_iCBPSPerLightBind = 1; struct CB_PS_PER_SCENE { D3DXPLANE m_vMirrorPlane; D3DXVECTOR4 m_vAmbientColor; D3DXVECTOR4 m_vTintColor; }; UINT g_iCBPSPerSceneBind = 2; ID3D11Buffer* g_pcbVSPerObject = NULL; ID3D11Buffer* g_pcbVSPerScene = NULL; ID3D11Buffer* g_pcbPSPerObject = NULL; ID3D11Buffer* g_pcbPSPerLight = NULL; ID3D11Buffer* g_pcbPSPerScene = NULL; bool g_bClearStateUponBeginCommandList = false; bool g_bClearStateUponFinishCommandList = false; bool g_bClearStateUponExecuteCommandList = false; unsigned int WINAPI _PerSceneRenderDeferredProc( LPVOID lpParameter ); const int g_iNumPerSceneRenderThreads = 1; HANDLE g_hPerSceneRenderDeferredThread[g_iNumPerSceneRenderThreads]; HANDLE g_hBeginPerSceneRenderDeferredEvent[g_iNumPerSceneRenderThreads]; HANDLE g_hEndPerSceneRenderDeferredEvent[g_iNumPerSceneRenderThreads]; ID3D11DeviceContext* g_pd3dPerSceneDeferredContext[g_iNumPerSceneRenderThreads] = {NULL}; ID3D11CommandList* g_pd3dPerSceneCommandList[g_iNumPerSceneRenderThreads] = {NULL}; int g_iPerSceneThreadInstanceData[g_iNumPerSceneRenderThreads]; unsigned int WINAPI _PerChunkRenderDeferredProc( LPVOID lpParameter ); const int g_iMaxPerChunkRenderThreads = 32; // For true scalability, this should not be fixed at compile-time const int g_iMaxPendingQueueEntries = 1024; // Max value of g_hBeginPerChunkRenderDeferredSemaphore int g_iNumPerChunkRenderThreads; // One thread per physical processor, minus the main thread HANDLE g_hPerChunkRenderDeferredThread[g_iMaxPerChunkRenderThreads]; HANDLE g_hBeginPerChunkRenderDeferredSemaphore[g_iMaxPerChunkRenderThreads]; HANDLE g_hEndPerChunkRenderDeferredEvent[g_iMaxPerChunkRenderThreads]; ID3D11DeviceContext* g_pd3dPerChunkDeferredContext[g_iMaxPerChunkRenderThreads] = {NULL}; ID3D11CommandList* g_pd3dPerChunkCommandList[g_iMaxPerChunkRenderThreads] = {NULL}; int g_iPerChunkThreadInstanceData[g_iMaxPerChunkRenderThreads]; ChunkQueue g_ChunkQueue[g_iMaxPerChunkRenderThreads]; int g_iPerChunkQueueOffset[g_iMaxPerChunkRenderThreads]; // next free portion of the queue to add an entry to bool g_bWireFrame = false; //-------------------------------------------------------------------------------------- // Default view parameters //-------------------------------------------------------------------------------------- CModelViewerCamera g_Camera; // A model viewing camera D3DXVECTOR3 g_vDefaultEye ( 30.0f, 150.0f, -150.0f ); D3DXVECTOR3 g_vDefaultLookAt ( 0.0f, 60.0f, 0.0f ); D3DXVECTOR3 g_vUp ( 0.0f, 1.0f, 0.0f ); D3DXVECTOR3 g_vDown = -g_vUp; FLOAT g_fNearPlane = 2.0f; FLOAT g_fFarPlane = 4000.0f; FLOAT g_fFOV = D3DX_PI / 4.0f; D3DXVECTOR3 g_vSceneCenter ( 0.0f, 350.0f, 0.0f ); FLOAT g_fSceneRadius = 600.0f; FLOAT g_fDefaultCameraRadius = 300.0f; FLOAT g_fMinCameraRadius = 150.0f; FLOAT g_fMaxCameraRadius = 450.0f; #ifdef RENDER_SCENE_LIGHT_POV bool g_bRenderSceneLightPOV = false; #endif //-------------------------------------------------------------------------------------- // Lighting params (to be read from content when the pipeline supports it) //-------------------------------------------------------------------------------------- D3DXVECTOR4 g_vAmbientColor ( 0.04f * 0.760f, 0.04f * 0.793f, 0.04f * 0.822f, 1.000f ); D3DXVECTOR4 g_vMirrorTint ( 0.3f, 0.5f, 1.0f, 1.0f ); D3DXVECTOR4 g_vLightColor[g_iNumLights]; D3DXVECTOR3 g_vLightPos[g_iNumLights]; D3DXVECTOR3 g_vLightDir[g_iNumLights]; FLOAT g_fLightFalloffDistEnd[g_iNumLights]; FLOAT g_fLightFalloffDistRange[g_iNumLights]; FLOAT g_fLightFalloffCosAngleEnd[g_iNumLights]; FLOAT g_fLightFalloffCosAngleRange[g_iNumLights]; FLOAT g_fLightFOV[g_iNumLights]; FLOAT g_fLightAspect[g_iNumLights]; FLOAT g_fLightNearPlane[g_iNumLights]; FLOAT g_fLightFarPlane[g_iNumLights]; // The scene data CMultiDeviceContextDXUTMesh g_Mesh11; //-------------------------------------------------------------------------------------- // Rendering interfaces //-------------------------------------------------------------------------------------- ID3D11InputLayout* g_pVertexLayout11 = NULL; ID3D11VertexShader* g_pVertexShader = NULL; ID3D11PixelShader* g_pPixelShader = NULL; ID3D11SamplerState* g_pSamPointClamp = NULL; ID3D11SamplerState* g_pSamLinearWrap = NULL; ID3D11RasterizerState* g_pRasterizerStateNoCull = NULL; ID3D11RasterizerState* g_pRasterizerStateBackfaceCull = NULL; ID3D11RasterizerState* g_pRasterizerStateFrontfaceCull = NULL; ID3D11RasterizerState* g_pRasterizerStateNoCullWireFrame = NULL; ID3D11DepthStencilState* g_pDepthStencilStateNoStencil = NULL; //-------------------------------------------------------------------------------------- // Mirror data and interfaces //-------------------------------------------------------------------------------------- D3DXVECTOR3 g_vMirrorCenter[g_iNumMirrors]; D3DXVECTOR3 g_vMirrorNormal[g_iNumMirrors]; D3DXPLANE g_vMirrorPlane[g_iNumMirrors]; FLOAT g_fMirrorWidth[g_iNumMirrors]; FLOAT g_fMirrorHeight[g_iNumMirrors]; FLOAT g_fMirrorResolutionX[g_iNumMirrors]; FLOAT g_fMirrorResolutionY[g_iNumMirrors]; D3DXVECTOR3 g_vMirrorCorner[4]; MirrorRect g_MirrorRect[g_iNumMirrors]; const UINT8 g_iStencilMask = 0x01; const UINT8 g_iStencilRef = 0x01; ID3D11DepthStencilState* g_pMirrorDepthStencilStateDepthTestStencilOverwrite = NULL; ID3D11DepthStencilState* g_pMirrorDepthStencilStateDepthOverwriteStencilTest = NULL; ID3D11DepthStencilState* g_pMirrorDepthStencilStateDepthWriteStencilTest = NULL; ID3D11DepthStencilState* g_pMirrorDepthStencilStateDepthOverwriteStencilClear = NULL; ID3D11Buffer* g_pMirrorVertexBuffer = NULL; ID3D11InputLayout* g_pMirrorVertexLayout11 = NULL; //-------------------------------------------------------------------------------------- // Shadow map data and interface //-------------------------------------------------------------------------------------- ID3D11Texture2D* g_pShadowTexture[g_iNumShadows] = { NULL }; ID3D11ShaderResourceView* g_pShadowResourceView[g_iNumShadows] = { NULL }; ID3D11DepthStencilView* g_pShadowDepthStencilView[g_iNumShadows] = { NULL }; D3D11_VIEWPORT g_ShadowViewport[g_iNumShadows] = { 0 }; FLOAT g_fShadowResolutionX[g_iNumShadows]; FLOAT g_fShadowResolutionY[g_iNumShadows]; //CCamera g_Camera; SceneParamsStatic g_StaticParamsDirect; SceneParamsStatic g_StaticParamsShadow[g_iNumShadows]; SceneParamsStatic g_StaticParamsMirror[g_iNumMirrors]; boost::movelib::unique_ptr<D3D11_Renderer> D3D11_Renderer::m_sInstance; //-------------------------------------------------------------------------------------- // Convenient checks for the current render pathway //-------------------------------------------------------------------------------------- inline bool IsRenderDeferredPerScene() { return g_iDeviceContextType == DEVICECONTEXT_ST_DEFERRED_PER_SCENE || g_iDeviceContextType == DEVICECONTEXT_MT_DEFERRED_PER_SCENE; } inline bool IsRenderMultithreadedPerScene() { return g_iDeviceContextType == DEVICECONTEXT_MT_DEFERRED_PER_SCENE; } inline bool IsRenderDeferredPerChunk() { return g_iDeviceContextType == DEVICECONTEXT_ST_DEFERRED_PER_CHUNK || g_iDeviceContextType == DEVICECONTEXT_MT_DEFERRED_PER_CHUNK; } inline bool IsRenderMultithreadedPerChunk() { return g_iDeviceContextType == DEVICECONTEXT_MT_DEFERRED_PER_CHUNK; } // Handle updates to the scene. This is called regardless of which D3D API is used //-------------------------------------------------------------------------------------- void D3D11_Renderer::OnFrameMove( double fTime, float fElapsedTime, void* pUserContext ) { static float fTotalTime = 0.0f; fTotalTime += fElapsedTime; m_Time = fTime; m_ElaspedTime = fElapsedTime; // Jigger the overhead lights --- these are hard-coded to indices 1,2,3 // Ideally, we'd attach the lights to the relevant objects in the mesh // file and animate those objects. But for now, just some hard-coded // swinging... float fCycle1X = 0.0f; float fCycle1Z = 0.20f * sinf( 2.0f * ( fTotalTime + 0.0f * D3DX_PI ) ); g_vLightDir[1] = g_vDown + D3DXVECTOR3( fCycle1X, 0.0f, fCycle1Z ); D3DXVec3Normalize( &g_vLightDir[1], &g_vLightDir[1] ); float fCycle2X = 0.10f * cosf( 1.6f * ( fTotalTime + 0.3f * D3DX_PI ) ); float fCycle2Z = 0.10f * sinf( 1.6f * ( fTotalTime + 0.0f * D3DX_PI ) ); g_vLightDir[2] = g_vDown + D3DXVECTOR3( fCycle2X, 0.0f, fCycle2Z ); D3DXVec3Normalize( &g_vLightDir[2], &g_vLightDir[2] ); float fCycle3X = 0.30f * cosf( 2.4f * ( fTotalTime + 0.3f * D3DX_PI ) ); float fCycle3Z = 0.0f; g_vLightDir[3] = g_vDown + D3DXVECTOR3( fCycle3X, 0.0f, fCycle3Z ); D3DXVec3Normalize( &g_vLightDir[3], &g_vLightDir[3] ); // Update the camera's position based on user input g_Camera.FrameMove( fElapsedTime ); } //-------------------------------------------------------------------------------------- // Figure out the ViewProj matrix from the light's perspective //-------------------------------------------------------------------------------------- void CalcLightViewProj( D3DXMATRIX* pmLightViewProj, int iLight ) { const D3DXVECTOR3& vLightDir = g_vLightDir[iLight]; const D3DXVECTOR3& vLightPos = g_vLightPos[iLight]; D3DXVECTOR3 vLookAt = vLightPos + g_fSceneRadius * vLightDir; D3DXMATRIX mLightView; D3DXMatrixLookAtLH( &mLightView, &vLightPos, &vLookAt, &g_vUp ); D3DXMATRIX mLightProj; D3DXMatrixPerspectiveFovLH( &mLightProj, g_fLightFOV[iLight], g_fLightAspect[iLight], g_fLightNearPlane[iLight], g_fLightFarPlane[iLight] ); *pmLightViewProj = mLightView * mLightProj; } //-------------------------------------------------------------------------------------- // Find and compile the specified shader //-------------------------------------------------------------------------------------- HRESULT CompileShaderFromFile( WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut ) { HRESULT hr = S_OK; DWORD dwShaderFlags = D3DCOMPILE_ENABLE_STRICTNESS; #if defined( DEBUG ) || defined( _DEBUG ) // Set the D3DCOMPILE_DEBUG flag to embed debug information in the shaders. // Setting this flag improves the shader debugging experience, but still allows // the shaders to be optimized and to run exactly the way they will run in // the release configuration of this program. dwShaderFlags |= D3DCOMPILE_DEBUG; #endif ID3DBlob* pErrorBlob; hr = D3DX11CompileFromFileW( szFileName, NULL, NULL, szEntryPoint, szShaderModel, dwShaderFlags, 0, NULL, ppBlobOut, &pErrorBlob, NULL ); if( FAILED(hr) ) { if( pErrorBlob != NULL ) OutputDebugStringA( (char*)pErrorBlob->GetBufferPointer() ); SAFE_RELEASE( pErrorBlob ); return hr; } SAFE_RELEASE( pErrorBlob ); return S_OK; } void InitializeLights() { // Our hand-tuned approximation to the sky light //g_vLightColor[0] = D3DXVECTOR4( 1.5f * 0.160f, 1.5f * 0.341f, 1.5f * 1.000f, 1.000f ); g_vLightColor[0] = D3DXVECTOR4( 3.0f * 0.160f, 3.0f * 0.341f, 3.0f * 1.000f, 1.000f ); g_vLightDir[0] = D3DXVECTOR3( -0.67f, -0.71f, +0.21f ); g_vLightPos[0] = g_vSceneCenter - g_fSceneRadius * g_vLightDir[0]; g_fLightFOV[0] = D3DX_PI / 4.0f; // The three overhead lamps g_vLightColor[1] = D3DXVECTOR4( 0.4f * 0.895f, 0.4f * 0.634f, 0.4f * 0.626f, 1.0f ); g_vLightPos[1] = D3DXVECTOR3( 0.0f, 400.0f, -250.0f ); g_vLightDir[1] = D3DXVECTOR3( 0.00f, -1.00f, 0.00f ); g_fLightFOV[1] = 65.0f * ( D3DX_PI / 180.0f ); g_vLightColor[2] = D3DXVECTOR4( 0.5f * 0.388f, 0.5f * 0.641f, 0.5f * 0.401f, 1.0f ); g_vLightPos[2] = D3DXVECTOR3( 0.0f, 400.0f, 0.0f ); g_vLightDir[2] = D3DXVECTOR3( 0.00f, -1.00f, 0.00f ); g_fLightFOV[2] = 65.0f * ( D3DX_PI / 180.0f ); g_vLightColor[3] = D3DXVECTOR4( 0.4f * 1.000f, 0.4f * 0.837f, 0.4f * 0.848f, 1.0f ); g_vLightPos[3] = D3DXVECTOR3( 0.0f, 400.0f, 250.0f ); g_vLightDir[3] = D3DXVECTOR3( 0.00f, -1.00f, 0.00f ); g_fLightFOV[3] = 65.0f * ( D3DX_PI / 180.0f ); // For the time beings, let's make these params follow the same pattern for all lights for ( int iLight = 0; iLight < g_iNumLights; ++iLight ) { g_fLightAspect[iLight] = 1.0f; g_fLightNearPlane[iLight] = 100.f; g_fLightFarPlane[iLight] = 2.0f * g_fSceneRadius; g_fLightFalloffDistEnd[iLight] = g_fLightFarPlane[iLight]; g_fLightFalloffDistRange[iLight] = 100.0f; g_fLightFalloffCosAngleEnd[iLight] = cosf( g_fLightFOV[iLight] / 2.0f ); g_fLightFalloffCosAngleRange[iLight] = 0.1f; D3DXVec3Normalize( &g_vLightDir[iLight], &g_vLightDir[iLight] ); } #ifdef ADJUSTABLE_LIGHT // The adjustable light is number 0 g_LightControl.SetLightDirection( g_vLightDir[0] ); #endif } //-------------------------------------------------------------------------------------- // Create D3D11 resources for the shadows //-------------------------------------------------------------------------------------- HRESULT InitializeShadows( ID3D11Device* pd3dDevice ) { HRESULT hr = S_OK; for ( int iShadow = 0; iShadow < g_iNumShadows; ++iShadow ) { // constant for now g_fShadowResolutionX[iShadow] = 2048.0f; g_fShadowResolutionY[iShadow] = 2048.0f; // The shadow map, along with depth-stencil and texture view D3D11_TEXTURE2D_DESC ShadowDesc = { ( int) g_fShadowResolutionX[iShadow], // UINT Width; ( int) g_fShadowResolutionY[iShadow], // UINT Height; 1, // UINT MipLevels; 1, // UINT ArraySize; DXGI_FORMAT_R32_TYPELESS, // DXGI_FORMAT Format; { 1, 0, }, // DXGI_SAMPLE_DESC SampleDesc; D3D11_USAGE_DEFAULT, // D3D11_USAGE Usage; D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_DEPTH_STENCIL, // UINT BindFlags; 0, // UINT CPUAccessFlags; 0, // UINT MiscFlags; }; D3D11_DEPTH_STENCIL_VIEW_DESC ShadowDepthStencilViewDesc = { DXGI_FORMAT_D32_FLOAT, // DXGI_FORMAT Format; D3D11_DSV_DIMENSION_TEXTURE2D, // D3D11_DSV_DIMENSION ViewDimension; 0, // UINT ReadOnlyUsage; {0, }, // D3D11_TEX2D_RTV Texture2D; }; D3D11_SHADER_RESOURCE_VIEW_DESC ShadowResourceViewDesc = { DXGI_FORMAT_R32_FLOAT, // DXGI_FORMAT Format; D3D11_SRV_DIMENSION_TEXTURE2D, // D3D11_SRV_DIMENSION ViewDimension; {0, 1, }, // D3D11_TEX2D_SRV Texture2D; }; pd3dDevice->CreateTexture2D( &ShadowDesc, NULL, &g_pShadowTexture[iShadow] ) ; DXUT_SetDebugName( g_pShadowTexture[iShadow], "Shadow" ); pd3dDevice->CreateDepthStencilView( g_pShadowTexture[iShadow], &ShadowDepthStencilViewDesc, &g_pShadowDepthStencilView[iShadow] ) ; DXUT_SetDebugName( g_pShadowDepthStencilView[iShadow], "Shadow DSV" ); pd3dDevice->CreateShaderResourceView( g_pShadowTexture[iShadow], &ShadowResourceViewDesc, &g_pShadowResourceView[iShadow] ) ; DXUT_SetDebugName( g_pShadowResourceView[iShadow] , "Shadow RSV" ); g_ShadowViewport[iShadow].Width = g_fShadowResolutionX[iShadow]; g_ShadowViewport[iShadow].Height = g_fShadowResolutionY[iShadow]; g_ShadowViewport[iShadow].MinDepth = 0; g_ShadowViewport[iShadow].MaxDepth = 1; g_ShadowViewport[iShadow].TopLeftX = 0; g_ShadowViewport[iShadow].TopLeftY = 0; // The parameters to pass to per-chunk threads for the shadow scenes g_StaticParamsShadow[iShadow].m_pDepthStencilState = g_pDepthStencilStateNoStencil; g_StaticParamsShadow[iShadow].m_iStencilRef = 0; g_StaticParamsShadow[iShadow].m_pRasterizerState = g_pRasterizerStateFrontfaceCull; g_StaticParamsShadow[iShadow].m_vMirrorPlane = D3DXPLANE( 0.0f, 0.0f, 0.0f, 0.0f ); g_StaticParamsShadow[iShadow].m_vTintColor = D3DXVECTOR4( 1.0f, 1.0f, 1.0f, 1.0f ); g_StaticParamsShadow[iShadow].m_pDepthStencilView = g_pShadowDepthStencilView[iShadow]; g_StaticParamsShadow[iShadow].m_pViewport = &g_ShadowViewport[iShadow]; } return hr; } //-------------------------------------------------------------------------------------- // Create D3D11 resources for the mirrors //-------------------------------------------------------------------------------------- HRESULT InitializeMirrors( ID3D11Device* pd3dDevice ) { HRESULT hr = S_OK; // The stencil method for the mirror rendering requires several different // depth-stencil states... // Write stencil if the depth test passes D3D11_DEPTH_STENCIL_DESC DepthStencilDescDepthTestStencilOverwrite = { TRUE, // BOOL DepthEnable; D3D11_DEPTH_WRITE_MASK_ZERO, // D3D11_DEPTH_WRITE_MASK DepthWriteMask; D3D11_COMPARISON_LESS_EQUAL, // D3D11_COMPARISON_FUNC DepthFunc; TRUE, // BOOL StencilEnable; 0, // UINT8 StencilReadMask; g_iStencilMask, // UINT8 StencilWriteMask; { // D3D11_DEPTH_STENCILOP_DESC FrontFace; D3D11_STENCIL_OP_REPLACE, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_REPLACE, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_ALWAYS, // D3D11_COMPARISON_FUNC StencilFunc; }, { // D3D11_DEPTH_STENCILOP_DESC BackFace; D3D11_STENCIL_OP_REPLACE, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_REPLACE, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_ALWAYS, // D3D11_COMPARISON_FUNC StencilFunc; }, }; pd3dDevice->CreateDepthStencilState( &DepthStencilDescDepthTestStencilOverwrite, &g_pMirrorDepthStencilStateDepthTestStencilOverwrite ) ; DXUT_SetDebugName( g_pMirrorDepthStencilStateDepthTestStencilOverwrite, "Mirror SO" ); // Overwrite depth and if stencil test passes D3D11_DEPTH_STENCIL_DESC DepthStencilDescDepthOverwriteStencilTest = { TRUE, // BOOL DepthEnable; D3D11_DEPTH_WRITE_MASK_ALL, // D3D11_DEPTH_WRITE_MASK DepthWriteMask; D3D11_COMPARISON_ALWAYS, // D3D11_COMPARISON_FUNC DepthFunc; TRUE, // BOOL StencilEnable; g_iStencilMask, // UINT8 StencilReadMask; 0, // UINT8 StencilWriteMask; { // D3D11_DEPTH_STENCILOP_DESC FrontFace; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_EQUAL, // D3D11_COMPARISON_FUNC StencilFunc; }, { // D3D11_DEPTH_STENCILOP_DESC BackFace; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_EQUAL, // D3D11_COMPARISON_FUNC StencilFunc; }, }; pd3dDevice->CreateDepthStencilState( &DepthStencilDescDepthOverwriteStencilTest, &g_pMirrorDepthStencilStateDepthOverwriteStencilTest ) ; DXUT_SetDebugName( g_pMirrorDepthStencilStateDepthOverwriteStencilTest, "Mirror DO" ); // Perform normal depth test/write if the stencil test passes D3D11_DEPTH_STENCIL_DESC DepthStencilDescDepthWriteStencilTest = { TRUE, // BOOL DepthEnable; D3D11_DEPTH_WRITE_MASK_ALL, // D3D11_DEPTH_WRITE_MASK DepthWriteMask; D3D11_COMPARISON_LESS_EQUAL, // D3D11_COMPARISON_FUNC DepthFunc; TRUE, // BOOL StencilEnable; g_iStencilMask, // UINT8 StencilReadMask; 0, // UINT8 StencilWriteMask; { // D3D11_DEPTH_STENCILOP_DESC FrontFace; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_EQUAL, // D3D11_COMPARISON_FUNC StencilFunc; }, { // D3D11_DEPTH_STENCILOP_DESC BackFace; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_EQUAL, // D3D11_COMPARISON_FUNC StencilFunc; }, }; pd3dDevice->CreateDepthStencilState( &DepthStencilDescDepthWriteStencilTest, &g_pMirrorDepthStencilStateDepthWriteStencilTest ) ; DXUT_SetDebugName( g_pMirrorDepthStencilStateDepthWriteStencilTest, "Mirror Normal" ); // Overwrite depth and clear stencil if stencil test passes D3D11_DEPTH_STENCIL_DESC DepthStencilDescDepthOverwriteStencilClear = { TRUE, // BOOL DepthEnable; D3D11_DEPTH_WRITE_MASK_ALL, // D3D11_DEPTH_WRITE_MASK DepthWriteMask; D3D11_COMPARISON_ALWAYS, // D3D11_COMPARISON_FUNC DepthFunc; TRUE, // BOOL StencilEnable; g_iStencilMask, // UINT8 StencilReadMask; g_iStencilMask, // UINT8 StencilWriteMask; { // D3D11_DEPTH_STENCILOP_DESC FrontFace; D3D11_STENCIL_OP_ZERO, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_ZERO, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_EQUAL, // D3D11_COMPARISON_FUNC StencilFunc; }, { // D3D11_DEPTH_STENCILOP_DESC BackFace; D3D11_STENCIL_OP_ZERO, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_ZERO, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_EQUAL, // D3D11_COMPARISON_FUNC StencilFunc; }, }; pd3dDevice->CreateDepthStencilState( &DepthStencilDescDepthOverwriteStencilClear, &g_pMirrorDepthStencilStateDepthOverwriteStencilClear ) ; DXUT_SetDebugName( g_pMirrorDepthStencilStateDepthOverwriteStencilClear, "Mirror Clear" ); // These values are hard-coded based on the sdkmesh contents, plus some // hand-fiddling, pending a better solution in the pipeline. g_vMirrorCenter[0].x = -35.1688f; g_vMirrorCenter[0].y = 89.279683f; g_vMirrorCenter[0].z = -0.7488765f; g_vMirrorCenter[1].x = 41.2174f; g_vMirrorCenter[1].y = 89.279683f; g_vMirrorCenter[1].z = -0.7488745f; g_vMirrorCenter[2].x = 3.024275f; g_vMirrorCenter[2].y = 89.279683f; g_vMirrorCenter[2].z = -54.344299f; g_vMirrorCenter[3].x = 3.02427475f; g_vMirrorCenter[3].y = 89.279683f; g_vMirrorCenter[3].z = 52.8466f; g_fMirrorWidth [0] = 104.190895f; g_fMirrorHeight[0] = 92.19922656f; g_fMirrorWidth [1] = 104.190899f; g_fMirrorHeight[1] = 92.19923178f; g_fMirrorWidth [2] = 76.3862f; g_fMirrorHeight[2] = 92.3427325f; g_fMirrorWidth [3] = 76.386196f; g_fMirrorHeight[3] = 92.34274043f; g_vMirrorNormal[0].x = -0.998638464f; g_vMirrorNormal[0].y = -0.052165297f; g_vMirrorNormal[0].z = 0.0f; g_vMirrorNormal[1].x = 0.998638407f; g_vMirrorNormal[1].y = -0.052166381f; g_vMirrorNormal[1].z = 3.15017E-08f; g_vMirrorNormal[2].x = 0.0f; g_vMirrorNormal[2].y = -0.076278878f; g_vMirrorNormal[2].z = -0.997086522f; g_vMirrorNormal[3].x = -5.22129E-08f; g_vMirrorNormal[3].y = -0.076279957f; g_vMirrorNormal[3].z = 0.99708644f; g_fMirrorResolutionX[0] = 320.0f; g_fMirrorResolutionY[0] = ( g_fMirrorResolutionX[0] * g_fMirrorHeight[0] / g_fMirrorWidth[0] ); g_fMirrorResolutionX[1] = 320.0f; g_fMirrorResolutionY[1] = ( g_fMirrorResolutionX[1] * g_fMirrorHeight[1] / g_fMirrorWidth[1] ); g_fMirrorResolutionX[2] = 320.0f; g_fMirrorResolutionY[2] = ( g_fMirrorResolutionX[2] * g_fMirrorHeight[2] / g_fMirrorWidth[2] ); g_fMirrorResolutionX[3] = 320.0f; g_fMirrorResolutionY[3] = ( g_fMirrorResolutionX[3] * g_fMirrorHeight[3] / g_fMirrorWidth[3] ); g_vMirrorCorner[0].x = -1.0f; g_vMirrorCorner[0].y = -1.0f; g_vMirrorCorner[0].z = 0.0f; g_vMirrorCorner[1].x = 1.0f; g_vMirrorCorner[1].y = -1.0f; g_vMirrorCorner[1].z = 0.0f; g_vMirrorCorner[2].x = -1.0f; g_vMirrorCorner[2].y = 1.0f; g_vMirrorCorner[2].z = 0.0f; g_vMirrorCorner[3].x = 1.0f; g_vMirrorCorner[3].y = 1.0f; g_vMirrorCorner[3].z = 0.0f; D3D11_BUFFER_DESC BufDesc; BufDesc.ByteWidth = sizeof( MirrorRect ); BufDesc.Usage = D3D11_USAGE_DYNAMIC; BufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; BufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; BufDesc.MiscFlags = 0; pd3dDevice->CreateBuffer( &BufDesc, NULL, &g_pMirrorVertexBuffer ); DXUT_SetDebugName( g_pMirrorVertexBuffer, "Mirror VB" ); for ( int iMirror = 0; iMirror < g_iNumMirrors; ++iMirror ) { D3DXPlaneFromPointNormal( &g_vMirrorPlane[iMirror], &g_vMirrorCenter[iMirror], &g_vMirrorNormal[iMirror] ); // The vertex buffer contents for the mirror quad, in local space. for ( UINT iCorner = 0; iCorner < 4; ++ iCorner ) { g_MirrorRect[iMirror][iCorner].Position.x = 0.5f * g_fMirrorWidth [iMirror] * g_vMirrorCorner[iCorner].x; g_MirrorRect[iMirror][iCorner].Position.y = 0.5f * g_fMirrorHeight[iMirror] * g_vMirrorCorner[iCorner].y; g_MirrorRect[iMirror][iCorner].Position.z = g_vMirrorCorner[iCorner].z; g_MirrorRect[iMirror][iCorner].Normal.x = g_MirrorRect[iMirror][iCorner].Normal.y = g_MirrorRect[iMirror][iCorner].Normal.z = 0.0f; g_MirrorRect[iMirror][iCorner].Texcoord.x = g_MirrorRect[iMirror][iCorner].Texcoord.y = 0.0f; g_MirrorRect[iMirror][iCorner].Tangent.x = g_MirrorRect[iMirror][iCorner].Tangent.y = g_MirrorRect[iMirror][iCorner].Tangent.z = 0.0f; } // The parameters to pass to per-chunk threads for the mirror scenes g_StaticParamsMirror[iMirror].m_pDepthStencilState = g_pMirrorDepthStencilStateDepthWriteStencilTest; g_StaticParamsMirror[iMirror].m_iStencilRef = g_iStencilRef; g_StaticParamsMirror[iMirror].m_pRasterizerState = g_pRasterizerStateBackfaceCull; g_StaticParamsMirror[iMirror].m_vMirrorPlane = g_vMirrorPlane[iMirror]; g_StaticParamsMirror[iMirror].m_vTintColor = g_vMirrorTint; g_StaticParamsMirror[iMirror].m_pDepthStencilView = NULL; g_StaticParamsMirror[iMirror].m_pViewport = NULL; } return S_OK; } D3D11_Renderer::D3D11_Renderer(const std::string& l_name) : m_name(l_name) { } void D3D11_Renderer::CreateDevice() { DXGI_SWAP_CHAIN_DESC sd; ZeroMemory( &sd, sizeof( sd ) ); sd.BufferCount = 1; sd.BufferDesc.Width = 640; sd.BufferDesc.Height = 480; sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; sd.BufferDesc.RefreshRate.Numerator = 60; sd.BufferDesc.RefreshRate.Denominator = 1; sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; sd.OutputWindow = CSimApplication::m_pSimApp->GetHwnd(); sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; sd.Windowed = TRUE; D3D_FEATURE_LEVEL FeatureLevelsRequested = D3D_FEATURE_LEVEL_11_0; UINT numLevelsRequested = 1; D3D_FEATURE_LEVEL FeatureLevelsSupported; auto result = D3D11CreateDeviceAndSwapChain( nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, &sd, &m_swapChain, &m_pDevice, nullptr, &m_pDeviceContext ); if (result != S_OK) { MessageBoxA(0, "Error Creating DX11 Device", "Error", 0); exit(0); } // Compile the shaders ID3DBlob* pVertexShaderBuffer = NULL; CompileShaderFromFile( L"MultithreadedRendering11_VS.hlsl", "VSMain", "vs_4_0", &pVertexShaderBuffer ); ID3DBlob* pPixelShaderBuffer = NULL; CompileShaderFromFile( L"MultithreadedRendering11_PS.hlsl", "PSMain", "ps_4_0", &pPixelShaderBuffer ) ; // Create the shaders m_pDevice->CreateVertexShader( pVertexShaderBuffer->GetBufferPointer(), pVertexShaderBuffer->GetBufferSize(), NULL, &g_pVertexShader ) ; m_pDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(), NULL, &g_pPixelShader ) ; DXUT_SetDebugName( g_pVertexShader, "VSMain" ); DXUT_SetDebugName( g_pPixelShader, "PSMain" ); // Create our vertex input layout // The content exporter supports either compressed or uncompressed formats for // normal/tangent/binormal. Unfortunately the relevant compressed formats are // deprecated for DX10+. So they required special handling in the vertex shader. // If we use uncompressed data here, need to also #define UNCOMPRESSED_VERTEX_DATA // in the HLSL file. const D3D11_INPUT_ELEMENT_DESC UncompressedLayout[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; const D3D11_INPUT_ELEMENT_DESC CompressedLayout[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "NORMAL", 0, DXGI_FORMAT_R10G10B10A2_UNORM, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R16G16_FLOAT, 0, 16, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TANGENT", 0, DXGI_FORMAT_R10G10B10A2_UNORM, 0, 20, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; #ifdef UNCOMPRESSED_VERTEX_DATA V_RETURN( pd3dDevice->CreateInputLayout( UncompressedLayout, ARRAYSIZE( UncompressedLayout ), pVertexShaderBuffer->GetBufferPointer(), pVertexShaderBuffer->GetBufferSize(), &g_pVertexLayout11 ) ); DXUT_SetDebugName(g_pVertexLayout11, "Uncompressed" ); #else m_pDevice->CreateInputLayout( CompressedLayout, ARRAYSIZE( CompressedLayout ), pVertexShaderBuffer->GetBufferPointer(), pVertexShaderBuffer->GetBufferSize(), &g_pVertexLayout11 ) ; DXUT_SetDebugName(g_pVertexLayout11, "Compressed" ); #endif m_pDevice->CreateInputLayout( UncompressedLayout, ARRAYSIZE( UncompressedLayout ), pVertexShaderBuffer->GetBufferPointer(), pVertexShaderBuffer->GetBufferSize(), &g_pMirrorVertexLayout11 ) ; DXUT_SetDebugName( g_pMirrorVertexLayout11, "Mirror" ); SAFE_RELEASE( pVertexShaderBuffer ); SAFE_RELEASE( pPixelShaderBuffer ); // The standard depth-stencil state D3D11_DEPTH_STENCIL_DESC DepthStencilDescNoStencil = { TRUE, // BOOL DepthEnable; D3D11_DEPTH_WRITE_MASK_ALL, // D3D11_DEPTH_WRITE_MASK DepthWriteMask; D3D11_COMPARISON_LESS_EQUAL, // D3D11_COMPARISON_FUNC DepthFunc; FALSE, // BOOL StencilEnable; 0, // UINT8 StencilReadMask; 0, // UINT8 StencilWriteMask; { // D3D11_DEPTH_STENCILOP_DESC FrontFace; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_NEVER, // D3D11_COMPARISON_FUNC StencilFunc; }, { // D3D11_DEPTH_STENCILOP_DESC BackFace; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilDepthFailOp; D3D11_STENCIL_OP_KEEP, // D3D11_STENCIL_OP StencilPassOp; D3D11_COMPARISON_NEVER, // D3D11_COMPARISON_FUNC StencilFunc; }, }; m_pDevice->CreateDepthStencilState( &DepthStencilDescNoStencil, &g_pDepthStencilStateNoStencil ) ; DXUT_SetDebugName( g_pDepthStencilStateNoStencil, "No Stencil" ); // Provide the intercept callback for CMultiDeviceContextDXUTMesh, which allows // us to farm out different mesh chunks to different device contexts void RenderMesh( CMultiDeviceContextDXUTMesh* pMesh, UINT iMesh, bool bAdjacent, ID3D11DeviceContext* pd3dDeviceContext, UINT iDiffuseSlot, UINT iNormalSlot, UINT iSpecularSlot ); MDC_SDKMESH_CALLBACKS11 MeshCallbacks; ZeroMemory( &MeshCallbacks, sizeof(MeshCallbacks) ); MeshCallbacks.pRenderMesh = RenderMesh; // Load the mesh g_Mesh11.Create( m_pDevice, L"SquidRoom\\SquidRoom.sdkmesh", true, &MeshCallbacks ) ; // Create sampler states for point/clamp (shadow map) and linear/wrap (everything else) D3D11_SAMPLER_DESC SamDesc; SamDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; SamDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; SamDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; SamDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; SamDesc.MipLODBias = 0.0f; SamDesc.MaxAnisotropy = 1; SamDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; SamDesc.BorderColor[0] = SamDesc.BorderColor[1] = SamDesc.BorderColor[2] = SamDesc.BorderColor[3] = 0; SamDesc.MinLOD = 0; SamDesc.MaxLOD = D3D11_FLOAT32_MAX; m_pDevice->CreateSamplerState( &SamDesc, &g_pSamPointClamp ) ; DXUT_SetDebugName( g_pSamPointClamp, "PointClamp" ); SamDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; SamDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; SamDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; SamDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; m_pDevice->CreateSamplerState( &SamDesc, &g_pSamLinearWrap ) ; DXUT_SetDebugName( g_pSamLinearWrap, "LinearWrap" ); // Setup constant buffers D3D11_BUFFER_DESC Desc; Desc.Usage = D3D11_USAGE_DYNAMIC; Desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; Desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; Desc.MiscFlags = 0; Desc.ByteWidth = sizeof( CB_VS_PER_SCENE ); m_pDevice->CreateBuffer( &Desc, NULL, &g_pcbVSPerScene ) ; DXUT_SetDebugName( g_pcbVSPerScene, "CB_VS_PER_SCENE" ); Desc.ByteWidth = sizeof( CB_VS_PER_OBJECT ); m_pDevice->CreateBuffer( &Desc, NULL, &g_pcbVSPerObject ) ; DXUT_SetDebugName( g_pcbVSPerObject, "CB_VS_PER_OBJECT" ); Desc.ByteWidth = sizeof( CB_PS_PER_SCENE ); m_pDevice->CreateBuffer( &Desc, NULL, &g_pcbPSPerScene ) ; DXUT_SetDebugName( g_pcbPSPerScene, "CB_PS_PER_SCENE" ); Desc.ByteWidth = sizeof( CB_PS_PER_OBJECT ); m_pDevice->CreateBuffer( &Desc, NULL, &g_pcbPSPerObject ) ; DXUT_SetDebugName( g_pcbPSPerObject, "CB_PS_PER_OBJECT" ); Desc.ByteWidth = sizeof( CB_PS_PER_LIGHT ); m_pDevice->CreateBuffer( &Desc, NULL, &g_pcbPSPerLight ) ; DXUT_SetDebugName( g_pcbPSPerLight, "CB_PS_PER_LIGHT" ); // Setup the camera's view parameters g_Camera.SetViewParams( &g_vDefaultEye, &g_vDefaultLookAt ); g_Camera.SetRadius( g_fDefaultCameraRadius, g_fMinCameraRadius, g_fMaxCameraRadius ); // Setup backface culling states: // 1) g_pRasterizerStateNoCull --- no culling (debugging only) // 2) g_pRasterizerStateBackfaceCull --- backface cull (mirror quads and the assets // reflected in the mirrors) // 3) g_pRasterizerStateFrontfaceCull --- frontface cull (pre-built assets from // the content pipeline) D3D11_RASTERIZER_DESC RasterizerDescNoCull = { D3D11_FILL_SOLID, // D3D11_FILL_MODE FillMode; D3D11_CULL_NONE, // D3D11_CULL_MODE CullMode; TRUE, // BOOL FrontCounterClockwise; 0, // INT DepthBias; 0, // FLOAT DepthBiasClamp; 0, // FLOAT SlopeScaledDepthBias; FALSE, // BOOL DepthClipEnable; FALSE, // BOOL ScissorEnable; TRUE, // BOOL MultisampleEnable; FALSE, // BOOL AntialiasedLineEnable; }; m_pDevice->CreateRasterizerState( &RasterizerDescNoCull, &g_pRasterizerStateNoCull ) ; DXUT_SetDebugName( g_pRasterizerStateNoCull, "NoCull" ); RasterizerDescNoCull.FillMode = D3D11_FILL_WIREFRAME; m_pDevice->CreateRasterizerState( &RasterizerDescNoCull, &g_pRasterizerStateNoCullWireFrame ) ; DXUT_SetDebugName( g_pRasterizerStateNoCullWireFrame, "Wireframe" ); D3D11_RASTERIZER_DESC RasterizerDescBackfaceCull = { D3D11_FILL_SOLID, // D3D11_FILL_MODE FillMode; D3D11_CULL_BACK, // D3D11_CULL_MODE CullMode; TRUE, // BOOL FrontCounterClockwise; 0, // INT DepthBias; 0, // FLOAT DepthBiasClamp; 0, // FLOAT SlopeScaledDepthBias; FALSE, // BOOL DepthClipEnable; FALSE, // BOOL ScissorEnable; TRUE, // BOOL MultisampleEnable; FALSE, // BOOL AntialiasedLineEnable; }; m_pDevice->CreateRasterizerState( &RasterizerDescBackfaceCull, &g_pRasterizerStateBackfaceCull ) ; DXUT_SetDebugName( g_pRasterizerStateBackfaceCull, "BackfaceCull" ); D3D11_RASTERIZER_DESC RasterizerDescFrontfaceCull = { D3D11_FILL_SOLID, // D3D11_FILL_MODE FillMode; D3D11_CULL_FRONT, // D3D11_CULL_MODE CullMode; TRUE, // BOOL FrontCounterClockwise; 0, // INT DepthBias; 0, // FLOAT DepthBiasClamp; 0, // FLOAT SlopeScaledDepthBias; FALSE, // BOOL DepthClipEnable; FALSE, // BOOL ScissorEnable; TRUE, // BOOL MultisampleEnable; FALSE, // BOOL AntialiasedLineEnable; }; m_pDevice->CreateRasterizerState( &RasterizerDescFrontfaceCull, &g_pRasterizerStateFrontfaceCull ) ; DXUT_SetDebugName( g_pRasterizerStateFrontfaceCull, "FrontfaceCull" ); // The parameters to pass to per-chunk threads for the main scene g_StaticParamsDirect.m_pDepthStencilState = g_pDepthStencilStateNoStencil; g_StaticParamsDirect.m_iStencilRef = 0; g_StaticParamsDirect.m_pRasterizerState = g_pRasterizerStateFrontfaceCull; g_StaticParamsDirect.m_vMirrorPlane = D3DXPLANE( 0.0f, 0.0f, 0.0f, 0.0f ); g_StaticParamsDirect.m_vTintColor = D3DXVECTOR4( 1.0f, 1.0f, 1.0f, 1.0f ); g_StaticParamsDirect.m_pDepthStencilView = NULL; g_StaticParamsDirect.m_pViewport = NULL; #ifdef DEBUG // These checks are important for avoiding implicit assumptions of D3D state carry-over // across device contexts. A very common source of error in multithreaded rendering // is setting some state in one context and inadvertently relying on that state in // another context. Setting all these flags to true should expose all such errors // (at non-trivial performance cost). // // The names mean a bit more than they say. The flags force that state be cleared when: // // 1) We actually perform the action in question (e.g. call FinishCommandList) // 2) We reach any point in the frame when the action could have been // performed (e.g. we are using DEVICECONTEXT_IMMEDIATE but would otherwise // have called FinishCommandList) // // This usage guarantees consistent behavior across the different pathways. // g_bClearStateUponBeginCommandList = true; g_bClearStateUponFinishCommandList = true; g_bClearStateUponExecuteCommandList = true; #endif InitializeLights(); InitializeShadows( m_pDevice ) ; InitializeMirrors( m_pDevice ) ; // Add additional worker threads for rendering InitializeWorkerThreads(m_pDevice); OnD3D11ResizedSwapChain(m_pDevice, m_swapChain, nullptr, nullptr); } void D3D11_Renderer::CreateRenderTarget() { CComPtr<ID3D11Texture2D> backBuffer; m_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&backBuffer); m_pDevice->CreateRenderTargetView(backBuffer, nullptr, &m_renderTargetView); backBuffer->GetDesc(&m_backBufferDesc); // Create a depth stencil view. CD3D11_TEXTURE2D_DESC depthStencilDesc( DXGI_FORMAT_D24_UNORM_S8_UINT, static_cast<UINT>(m_backBufferDesc.Width), static_cast<UINT>(m_backBufferDesc.Height), 1, 1, D3D11_BIND_DEPTH_STENCIL ); CComPtr<ID3D11Texture2D> depthStencil; m_pDevice->CreateTexture2D( &depthStencilDesc, nullptr, &depthStencil ); CD3D11_DEPTH_STENCIL_VIEW_DESC depthStencilViewDesc(D3D11_DSV_DIMENSION_TEXTURE2D); // FIXME //m_pDevice->CreateDepthStencilView(depthStencil, &depthStencilViewDesc, &m_depthStencilView); } //-------------------------------------------------------------------------------------- // Create per-worker-thread resources //-------------------------------------------------------------------------------------- HRESULT InitializeWorkerThreads( ID3D11Device* pd3dDevice ) { HRESULT hr; // Per-scene data init for ( int iInstance = 0; iInstance < g_iNumPerSceneRenderThreads; ++iInstance ) { g_iPerSceneThreadInstanceData[iInstance] = iInstance; g_hBeginPerSceneRenderDeferredEvent[iInstance] = CreateEvent( NULL, FALSE, FALSE, NULL ); g_hEndPerSceneRenderDeferredEvent[iInstance] = CreateEvent( NULL, FALSE, FALSE, NULL ); pd3dDevice->CreateDeferredContext( 0 /*Reserved for future use*/, &g_pd3dPerSceneDeferredContext[iInstance] ) ; g_hPerSceneRenderDeferredThread[iInstance] = ( HANDLE )_beginthreadex( NULL, 0, _PerSceneRenderDeferredProc, &g_iPerSceneThreadInstanceData[iInstance], CREATE_SUSPENDED, NULL ); #if defined(PROFILE) || defined(DEBUG) char threadid[ 16 ]; sprintf_s( threadid, sizeof(threadid), "PS %d", iInstance ); DXUT_SetDebugName( g_pd3dPerSceneDeferredContext[iInstance], threadid ); #endif ResumeThread( g_hPerSceneRenderDeferredThread[iInstance] ); } // Per-chunk data init // Reserve one core for the main thread if possible g_iNumPerChunkRenderThreads = 2; // Restrict to the max static allocation --- can be easily relaxed if need be g_iNumPerChunkRenderThreads = min( g_iNumPerChunkRenderThreads, g_iMaxPerChunkRenderThreads ); // Need at least on worker thread, even on a single-core machine g_iNumPerChunkRenderThreads = max( g_iNumPerChunkRenderThreads, 1 ); // uncomment to force exactly one worker context (and therefore predictable render order) //g_iNumPerChunkRenderThreads = 1; for ( int iInstance = 0; iInstance < g_iNumPerChunkRenderThreads; ++iInstance ) { g_iPerChunkThreadInstanceData[iInstance] = iInstance; g_hBeginPerChunkRenderDeferredSemaphore[iInstance] = CreateSemaphore( NULL, 0, g_iMaxPendingQueueEntries, NULL ); g_hEndPerChunkRenderDeferredEvent[iInstance] = CreateEvent( NULL, FALSE, FALSE, NULL ); pd3dDevice->CreateDeferredContext( 0 /*Reserved for future use*/, &g_pd3dPerChunkDeferredContext[iInstance] ) ; g_hPerChunkRenderDeferredThread[iInstance] = ( HANDLE )_beginthreadex( NULL, 0, _PerChunkRenderDeferredProc, &g_iPerChunkThreadInstanceData[iInstance], CREATE_SUSPENDED, NULL ); #if defined(PROFILE) || defined(DEBUG) char threadid[ 16 ]; sprintf_s( threadid, sizeof(threadid), "PC %d", iInstance ); DXUT_SetDebugName( g_pd3dPerChunkDeferredContext[iInstance], threadid ); #endif ResumeThread( g_hPerChunkRenderDeferredThread[iInstance] ); } return S_OK; } // There are a couple of threads participating the rendering // 1) main thread // 2) worker threads void D3D11_Renderer::Render() { //ID3D11DeviceContext* pImmediateContext = NULL; //m_pDevice->CreateDeferredContext(0, &pImmediateContext); Render(m_pDevice, m_pDeviceContext, m_Time, m_ElaspedTime, nullptr); } // main thread that participates in rendering void D3D11_Renderer::Render ( ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime, float fElapsedTime, void* pUserContext ) { HRESULT hr; //#ifdef ADJUSTABLE_LIGHT // g_vLightDir[0] = g_LightControl.GetLightDirection(); // g_vLightPos[0] = g_vSceneCenter - g_fSceneRadius * g_vLightDir[0]; //#endif if ( g_bClearStateUponBeginCommandList ) { pd3dImmediateContext->ClearState(); DXUTSetupD3D11Views( pd3dImmediateContext ) ; } // Clear the render target float ClearColor[4] = { 0.0f, 0.25f, 0.25f, 0.55f }; pd3dImmediateContext->ClearRenderTargetView( m_renderTargetView, ClearColor ); pd3dImmediateContext->ClearDepthStencilView( m_depthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0, 0 ); // 1) Render into the context and renders as a batch // Three possible render pathways: if ( IsRenderMultithreadedPerScene() ) { // Signal all worker threads, then wait for completion for ( int iInstance = 0; iInstance < g_iNumPerSceneRenderThreads; ++iInstance ) { // signal ready for scene kickoff SetEvent( g_hBeginPerSceneRenderDeferredEvent[iInstance] ); } // wait for completion WaitForMultipleObjects( g_iNumPerSceneRenderThreads, g_hEndPerSceneRenderDeferredEvent, TRUE, INFINITE ); } else if ( IsRenderDeferredPerScene() ) { // Perform the same tasks, serialized on the main thread but using deferred contexts for ( int iShadow = 0; iShadow < g_iNumShadows; ++iShadow ) { // Render into a context RenderShadow( iShadow, g_pd3dPerSceneDeferredContext[iShadow] ); g_pd3dPerSceneDeferredContext[iShadow]->FinishCommandList( !g_bClearStateUponFinishCommandList, &g_pd3dPerSceneCommandList[iShadow] ) ; } for ( int iMirror = 0; iMirror < g_iNumMirrors; ++iMirror ) { RenderMirror( iMirror, g_pd3dPerSceneDeferredContext[iMirror] ); g_pd3dPerSceneDeferredContext[iMirror]->FinishCommandList( !g_bClearStateUponFinishCommandList, &g_pd3dPerSceneCommandList[g_iNumShadows + iMirror] ) ; } RenderSceneDirect( g_pd3dPerSceneDeferredContext[g_iNumMirrors] ); g_pd3dPerSceneDeferredContext[g_iNumMirrors]->FinishCommandList( !g_bClearStateUponFinishCommandList, &g_pd3dPerSceneCommandList[g_iNumShadows + g_iNumMirrors] ); } else { // Perform the same tasks, serialized on the main thread using the immediate context for ( int iShadow = 0; iShadow < g_iNumShadows; ++iShadow ) { RenderShadow( iShadow, pd3dImmediateContext ); } for ( int iMirror = 0; iMirror < g_iNumMirrors; ++iMirror ) { RenderMirror( iMirror, pd3dImmediateContext ); } RenderSceneDirect( pd3dImmediateContext ); } /// These are executed by worker threads off-line // If we are doing ST_DEFERRED_PER_SCENE or MT_DEFERRED_PER_SCENE, we have generated a // bunch of command lists. Execute those lists now. if ( IsRenderDeferredPerScene() ) { for ( int iInstance = 0; iInstance < g_iNumPerSceneRenderThreads; ++iInstance ) { pd3dImmediateContext->ExecuteCommandList( g_pd3dPerSceneCommandList[iInstance], !g_bClearStateUponExecuteCommandList ); SAFE_RELEASE( g_pd3dPerSceneCommandList[iInstance] ); } } else { // If we rendered directly, optionally clear state for consistent behavior with // the other render pathways. if ( g_bClearStateUponFinishCommandList || g_bClearStateUponExecuteCommandList ) { pd3dImmediateContext->ClearState(); } } DXUTSetupD3D11Views( pd3dImmediateContext ) ; } HRESULT OnD3D11ResizedSwapChain( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain, const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc, void* pUserContext ) { HRESULT hr; // V_RETURN( g_DialogResourceManager.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) ); // V_RETURN( g_D3DSettingsDlg.OnD3D11ResizedSwapChain( pd3dDevice, pBackBufferSurfaceDesc ) ); // Setup the camera's projection parameters //float fAspectRatio = pBackBufferSurfaceDesc->Width / ( FLOAT )pBackBufferSurfaceDesc->Height; float fAspectRatio = 800.0f / 600.0f; g_Camera.SetProjParams( g_fFOV, fAspectRatio, g_fNearPlane, g_fFarPlane ); g_Camera.SetWindow( 800.0f, 600.0f ); // g_Camera.SetButtonMasks( MOUSE_MIDDLE_BUTTON, MOUSE_WHEEL, MOUSE_LEFT_BUTTON ); //g_HUD.SetLocation( pBackBufferSurfaceDesc->Width - 170, 0 ); //g_HUD.SetSize( 170, 170 ); //g_SampleUI.SetLocation( pBackBufferSurfaceDesc->Width - 170, pBackBufferSurfaceDesc->Height - 300 ); //g_SampleUI.SetSize( 170, 300 ); return S_OK; } // 2 additional threads participating in rendering //-------------------------------------------------------------------------------------- // The per-scene worker thread entry point. Loops infinitely, rendering either a // shadow scene or a mirror scene or the main scene into a command list. //-------------------------------------------------------------------------------------- unsigned int WINAPI _PerSceneRenderDeferredProc( LPVOID lpParameter ) { HRESULT hr; // thread local data const int iInstance = *( int*)lpParameter; ID3D11DeviceContext* pd3dDeferredContext = g_pd3dPerSceneDeferredContext[iInstance]; ID3D11CommandList*& pd3dCommandList = g_pd3dPerSceneCommandList[iInstance]; for (;;) { // Wait for main thread to signal ready WaitForSingleObject( g_hBeginPerSceneRenderDeferredEvent[iInstance], INFINITE ); if ( g_bClearStateUponBeginCommandList ) { pd3dDeferredContext->ClearState(); } if ( iInstance < g_iNumShadows ) { RenderShadow( iInstance, pd3dDeferredContext ); } else if ( iInstance < g_iNumShadows + g_iNumMirrors ) { RenderMirror( iInstance - g_iNumShadows, pd3dDeferredContext ); } else { RenderSceneDirect( pd3dDeferredContext ); } pd3dDeferredContext->FinishCommandList( !g_bClearStateUponFinishCommandList, &pd3dCommandList ) ; // Tell main thread command list is finished SetEvent( g_hEndPerSceneRenderDeferredEvent[iInstance] ); } } // 2 additional threads participating in rendering //-------------------------------------------------------------------------------------- // The per-chunk worker thread entry point. Loops infinitely, rendering an arbitrary // set of objects, from an arbitrary type of scene, into a command list. //-------------------------------------------------------------------------------------- unsigned int WINAPI _PerChunkRenderDeferredProc( LPVOID lpParameter ) { HRESULT hr; // thread local data const int iInstance = *( int*)lpParameter; ID3D11DeviceContext* pd3dDeferredContext = g_pd3dPerChunkDeferredContext[iInstance]; ID3D11CommandList*& pd3dCommandList = g_pd3dPerChunkCommandList[iInstance]; const ChunkQueue& LocalQueue = g_ChunkQueue[iInstance]; // The next queue entry to be read. Since we wait for the semaphore signal count to be greater // than zero, this index doesn't require explicit synchronization. int iQueueOffset = 0; for (;;) { // Wait for a work queue entry WaitForSingleObject( g_hBeginPerChunkRenderDeferredSemaphore[iInstance], INFINITE ); assert( iQueueOffset < g_iSceneQueueSizeInBytes ); const WorkQueueEntryBase* pEntry = (WorkQueueEntryBase*) &LocalQueue[iQueueOffset]; switch ( pEntry->m_iType ) { // Begin the scene by setting all required state case WORK_QUEUE_ENTRY_TYPE_SETUP: { const WorkQueueEntrySetup* pSetupEntry = (WorkQueueEntrySetup*) pEntry; if ( g_bClearStateUponBeginCommandList ) { pd3dDeferredContext->ClearState(); } RenderSceneSetup( pd3dDeferredContext, pSetupEntry->m_pSceneParamsStatic, &pSetupEntry->m_SceneParamsDynamic ) ; iQueueOffset += sizeof(WorkQueueEntrySetup); break; } // Submit a single chunk to the deferred context case WORK_QUEUE_ENTRY_TYPE_CHUNK: { const WorkQueueEntryChunk* pChunkEntry = (WorkQueueEntryChunk*) pEntry; // Submit work to deferred context RenderMeshDirect( pd3dDeferredContext, pChunkEntry->m_iMesh ); iQueueOffset += sizeof(WorkQueueEntryChunk); break; } // Finalize scene rendering case WORK_QUEUE_ENTRY_TYPE_FINALIZE: { // Finalize preceding work pd3dDeferredContext->FinishCommandList( !g_bClearStateUponFinishCommandList, &pd3dCommandList ) ; // Tell main thread command list is finished SetEvent( g_hEndPerChunkRenderDeferredEvent[iInstance] ); iQueueOffset += sizeof(WorkQueueEntryFinalize); // unnecessary currently as this is the last item // Reset queue iQueueOffset = 0; break; } // Error --- unrecognized entry type default: assert( false ); break; } } } //-------------------------------------------------------------------------------------- // Render the shadow map //-------------------------------------------------------------------------------------- VOID RenderShadow( int iShadow, ID3D11DeviceContext* pd3dContext ) { HRESULT hr; SceneParamsDynamic DynamicParams; CalcLightViewProj( &DynamicParams.m_mViewProj, iShadow ); RenderScene( pd3dContext, &g_StaticParamsShadow[iShadow], &DynamicParams ) ; } //-------------------------------------------------------------------------------------- // Render the mirror quad into the stencil buffer, and then render the world into // the stenciled area, using the mirrored projection matrix //-------------------------------------------------------------------------------------- VOID RenderMirror( int iMirror, ID3D11DeviceContext* pd3dContext ) { HRESULT hr; D3D11_MAPPED_SUBRESOURCE MappedResource; D3DXVECTOR3 vEyePoint; D3DXMATRIX mViewProj; #ifdef RENDER_SCENE_LIGHT_POV if ( g_bRenderSceneLightPOV ) { vEyePoint = g_vLightPos[0]; CalcLightViewProj( &mViewProj, 0 ); } else #endif { // Find the right view matrix for the mirror. vEyePoint = *g_Camera.GetEyePt(); mViewProj = *g_Camera.GetViewMatrix() * *g_Camera.GetProjMatrix(); } // Test for back-facing mirror (from whichever pov we are using) if ( D3DXPlaneDotCoord( &g_vMirrorPlane[iMirror], &vEyePoint ) < 0.0f ) { return; } D3DXMATRIX mReflect; D3DXMatrixReflect( &mReflect, &g_vMirrorPlane[iMirror] ); // Set up the mirror local-to-world matrix (could be done at initialize time) D3DXVECTOR3 vMirrorPointAt; D3DXVec3Add( &vMirrorPointAt, &g_vMirrorNormal[iMirror], &g_vMirrorCenter[iMirror] ); D3DXMATRIX mMirrorWorld; D3DXMatrixLookAtLH( &mMirrorWorld, &vMirrorPointAt, &g_vMirrorCenter[iMirror], &g_vUp ); D3DXMatrixTranspose( &mMirrorWorld, &mMirrorWorld ); mMirrorWorld._41 = g_vMirrorCenter[iMirror].x; mMirrorWorld._42 = g_vMirrorCenter[iMirror].y; mMirrorWorld._43 = g_vMirrorCenter[iMirror].z; mMirrorWorld._14 = 0; mMirrorWorld._24 = 0; mMirrorWorld._34 = 0; mMirrorWorld._44 = 1; if ( g_bClearStateUponBeginCommandList ) { pd3dContext->ClearState(); } // Restore the main view DXUTSetupD3D11Views( pd3dContext ); //-------------------------------------------------------------------------------------- // Draw the mirror quad into the stencil buffer, setting the stencil ref value //-------------------------------------------------------------------------------------- // Set the depth-stencil state pd3dContext->OMSetDepthStencilState( g_pMirrorDepthStencilStateDepthTestStencilOverwrite, g_iStencilRef ); // Set the cull state pd3dContext->RSSetState( g_pRasterizerStateBackfaceCull ); // Set inputs for the mirror shader pd3dContext->IASetInputLayout( g_pMirrorVertexLayout11 ); pd3dContext->IASetPrimitiveTopology( D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP ); ID3D11Buffer* pVB[1] = { g_pMirrorVertexBuffer }; UINT pStride[1] = { sizeof(MirrorVertex) }; UINT pOffset[1] = { 0 }; pd3dContext->IASetVertexBuffers( 0, 1, pVB, pStride, pOffset ); pd3dContext->VSSetShader( g_pVertexShader, NULL, 0 ); pd3dContext->PSSetShader( NULL, NULL, 0 ); // Set the corners of the mirror vertex buffer. The UVs aren't used here pd3dContext->Map( g_pMirrorVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; memcpy( MappedResource.pData, g_MirrorRect[iMirror], sizeof(g_MirrorRect[iMirror]) ); pd3dContext->Unmap( g_pMirrorVertexBuffer, 0 ); // Set up the transform matrices in the constant buffer pd3dContext->Map( g_pcbVSPerObject, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; CB_VS_PER_OBJECT* pVSPerObject = ( CB_VS_PER_OBJECT* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerObject->m_mWorld, &mMirrorWorld ); pd3dContext->Unmap( g_pcbVSPerObject, 0 ); pd3dContext->VSSetConstantBuffers( g_iCBVSPerObjectBind, 1, &g_pcbVSPerObject ); pd3dContext->Map( g_pcbVSPerScene, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; CB_VS_PER_SCENE* pVSPerScene = ( CB_VS_PER_SCENE* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerScene->m_mViewProj, &mViewProj ); pd3dContext->Unmap( g_pcbVSPerScene, 0 ); pd3dContext->VSSetConstantBuffers( g_iCBVSPerSceneBind, 1, &g_pcbVSPerScene ); pd3dContext->Draw( 4, 0 ); //-------------------------------------------------------------------------------------- // Clear depth, only within the stencilled area //-------------------------------------------------------------------------------------- // Set the depth-stencil state pd3dContext->OMSetDepthStencilState( g_pMirrorDepthStencilStateDepthOverwriteStencilTest, g_iStencilRef ); // Set up the transform matrices to alway output depth equal to the far plane (z = w of output) pd3dContext->Map( g_pcbVSPerScene, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; pVSPerScene = ( CB_VS_PER_SCENE* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerScene->m_mViewProj, &mViewProj ); pVSPerScene->m_mViewProj._31 = mViewProj._14; pVSPerScene->m_mViewProj._32 = mViewProj._24; pVSPerScene->m_mViewProj._33 = mViewProj._34; pVSPerScene->m_mViewProj._34 = mViewProj._44; pd3dContext->Unmap( g_pcbVSPerScene, 0 ); pd3dContext->Draw( 4, 0 ); //-------------------------------------------------------------------------------------- // Draw the mirrored world into the stencilled area //-------------------------------------------------------------------------------------- SceneParamsDynamic DynamicParams; DynamicParams.m_mViewProj = mReflect * mViewProj; RenderScene( pd3dContext, &g_StaticParamsMirror[iMirror], &DynamicParams ) ; //-------------------------------------------------------------------------------------- // Clear the stencil bit to 0 over the mirror quad. // At the same time, set the depth buffer to the depth value of the mirror. //-------------------------------------------------------------------------------------- // Assume this context is completely from scratch, since we've just come back from // scene rendering DXUTSetupD3D11Views( pd3dContext ) ; // Set the depth-stencil state pd3dContext->OMSetDepthStencilState( g_pMirrorDepthStencilStateDepthOverwriteStencilClear, g_iStencilRef ); // Set the cull state pd3dContext->RSSetState( g_pRasterizerStateBackfaceCull ); // Set inputs for the mirror shader pd3dContext->IASetInputLayout( g_pMirrorVertexLayout11 ); pd3dContext->IASetPrimitiveTopology( D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP ); pd3dContext->IASetVertexBuffers( 0, 1, pVB, pStride, pOffset ); pd3dContext->VSSetShader( g_pVertexShader, NULL, 0 ); pd3dContext->PSSetShader( NULL, NULL, 0 ); // Set up the transform matrices pd3dContext->Map( g_pcbVSPerObject, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; pVSPerObject = ( CB_VS_PER_OBJECT* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerObject->m_mWorld, &mMirrorWorld ); pd3dContext->Unmap( g_pcbVSPerObject, 0 ); pd3dContext->VSSetConstantBuffers( g_iCBVSPerObjectBind, 1, &g_pcbVSPerObject ); pd3dContext->Map( g_pcbVSPerScene, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; pVSPerScene = ( CB_VS_PER_SCENE* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerScene->m_mViewProj, &mViewProj ); pd3dContext->Unmap( g_pcbVSPerScene, 0 ); pd3dContext->VSSetConstantBuffers( g_iCBVSPerSceneBind, 1, &g_pcbVSPerScene ); pd3dContext->Draw( 4, 0 ); } // Called by Threads themselves //-------------------------------------------------------------------------------------- // Perform per-scene d3d context set-up. This should be enough setup that you can // start with a completely new device context, and then successfully call RenderMesh // afterwards. //-------------------------------------------------------------------------------------- HRESULT RenderSceneSetup( ID3D11DeviceContext* pd3dContext, const SceneParamsStatic* pStaticParams, const SceneParamsDynamic* pDynamicParams ) { HRESULT hr = E_FAIL; D3D11_MAPPED_SUBRESOURCE MappedResource; BOOL bShadow = ( pStaticParams->m_pDepthStencilView != NULL ); // Use all shadow maps as textures, or else one shadow map as depth-stencil if ( bShadow ) { // No shadow maps as textures ID3D11ShaderResourceView* ppNullResources[g_iNumShadows] = { NULL }; pd3dContext->PSSetShaderResources( 2, g_iNumShadows, ppNullResources ); // Given shadow map as depth-stencil, no render target pd3dContext->RSSetViewports( 1, pStaticParams->m_pViewport ); pd3dContext->OMSetRenderTargets( 0, NULL, pStaticParams->m_pDepthStencilView ); } else { // Standard DXUT render target and depth-stencil DXUTSetupD3D11Views( pd3dContext ) ; // All shadow maps as textures pd3dContext->PSSetShaderResources( 2, g_iNumShadows, g_pShadowResourceView ); } // Set the depth-stencil state pd3dContext->OMSetDepthStencilState( pStaticParams->m_pDepthStencilState, pStaticParams->m_iStencilRef ); // Set the rasterizer state pd3dContext->RSSetState( g_bWireFrame ? g_pRasterizerStateNoCullWireFrame: pStaticParams->m_pRasterizerState ); // Set the shaders pd3dContext->VSSetShader( g_pVertexShader, NULL, 0 ); // Set the vertex buffer format pd3dContext->IASetInputLayout( g_pVertexLayout11 ); // Set the VS per-scene constant data pd3dContext->Map( g_pcbVSPerScene, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; CB_VS_PER_SCENE* pVSPerScene = ( CB_VS_PER_SCENE* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerScene->m_mViewProj, &pDynamicParams->m_mViewProj ); pd3dContext->Unmap( g_pcbVSPerScene, 0 ); pd3dContext->VSSetConstantBuffers( g_iCBVSPerSceneBind, 1, &g_pcbVSPerScene ); if ( bShadow ) { pd3dContext->PSSetShader( NULL, NULL, 0 ); } else { pd3dContext->PSSetShader( g_pPixelShader, NULL, 0 ); ID3D11SamplerState* ppSamplerStates[2] = { g_pSamPointClamp, g_pSamLinearWrap }; pd3dContext->PSSetSamplers( 0, 2, ppSamplerStates ); // Set the PS per-scene constant data // A user clip plane prevents drawing things into the mirror which are behind the mirror plane pd3dContext->Map( g_pcbPSPerScene, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; CB_PS_PER_SCENE* pPSPerScene = ( CB_PS_PER_SCENE* )MappedResource.pData; pPSPerScene->m_vMirrorPlane = pStaticParams->m_vMirrorPlane; pPSPerScene->m_vAmbientColor = g_vAmbientColor; pPSPerScene->m_vTintColor = pStaticParams->m_vTintColor; pd3dContext->Unmap( g_pcbPSPerScene, 0 ); pd3dContext->PSSetConstantBuffers( g_iCBPSPerSceneBind, 1, &g_pcbPSPerScene ); // Set the PS per-light constant data pd3dContext->Map( g_pcbPSPerLight, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ) ; CB_PS_PER_LIGHT* pPSPerLight = ( CB_PS_PER_LIGHT* )MappedResource.pData; for ( int iLight = 0; iLight < g_iNumLights; ++iLight ) { D3DXVECTOR4 vLightPos = D3DXVECTOR4( g_vLightPos[iLight].x, g_vLightPos[iLight].y, g_vLightPos[iLight].z, 1.0f ); D3DXVECTOR4 vLightDir = D3DXVECTOR4( g_vLightDir[iLight].x, g_vLightDir[iLight].y, g_vLightDir[iLight].z, 0.0f ); D3DXMATRIX mLightViewProj; CalcLightViewProj( &mLightViewProj, iLight ); pPSPerLight->m_LightData[iLight].m_vLightColor = g_vLightColor[iLight]; pPSPerLight->m_LightData[iLight].m_vLightPos = vLightPos; pPSPerLight->m_LightData[iLight].m_vLightDir = vLightDir; D3DXMatrixTranspose( &pPSPerLight->m_LightData[iLight].m_mLightViewProj, &mLightViewProj ); pPSPerLight->m_LightData[iLight].m_vFalloffs = D3DXVECTOR4( g_fLightFalloffDistEnd[iLight], g_fLightFalloffDistRange[iLight], g_fLightFalloffCosAngleEnd[iLight], g_fLightFalloffCosAngleRange[iLight]); } pd3dContext->Unmap( g_pcbPSPerLight, 0 ); pd3dContext->PSSetConstantBuffers( g_iCBPSPerLightBind, 1, &g_pcbPSPerLight ); } return hr; } // Called by threads themselves // 1) // threads -> RenderSceneDirect -> RenderScene //-------------------------------------------------------------------------------------- // Render the scene into the world (not into a mirror or a shadow map) //-------------------------------------------------------------------------------------- VOID RenderSceneDirect( ID3D11DeviceContext* pd3dContext ) { HRESULT hr; SceneParamsDynamic DynamicParams; DynamicParams.m_mViewProj = *g_Camera.GetViewMatrix() * *g_Camera.GetProjMatrix(); #ifdef RENDER_SCENE_LIGHT_POV if ( g_bRenderSceneLightPOV ) { CalcLightViewProj( &DynamicParams.m_mViewProj, 0 ); } #endif // Call gMesh11.Render(); RenderScene( pd3dContext, &g_StaticParamsDirect, &DynamicParams ); } // 2 // threads -> RenderSceneDirect -> RenderScene -> gMesh11.Render... //-------------------------------------------------------------------------------------- // Render the scene from either: // - The immediate context in main thread, or // - A deferred context in the main thread, or // - A deferred context in a worker thread // - Several deferred contexts in the main thread, handling objects alternately // - Several deferred contexts in worker threads, handling objects alternately // The scene can be either the main scene, a mirror scene, or a shadow map scene //-------------------------------------------------------------------------------------- HRESULT RenderScene( ID3D11DeviceContext* pd3dContext, const SceneParamsStatic *pStaticParams, const SceneParamsDynamic *pDynamicParams ) { HRESULT hr = S_OK; // Make sure we're not relying on any state being inherited if ( g_bClearStateUponBeginCommandList ) { pd3dContext->ClearState(); } // Clear the shadow buffer if ( pStaticParams->m_pDepthStencilView != NULL ) { pd3dContext->ClearDepthStencilView( pStaticParams->m_pDepthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0, 0 ); } // Perform scene setup on every d3d context we will use if ( IsRenderMultithreadedPerChunk() ) { for ( int iInstance = 0; iInstance < g_iNumPerChunkRenderThreads; ++iInstance ) { // Reset count g_iPerChunkQueueOffset[iInstance] = 0; // Create and submit a worker queue entry ChunkQueue& WorkerQueue = g_ChunkQueue[iInstance]; int iQueueOffset = g_iPerChunkQueueOffset[iInstance]; HANDLE hSemaphore = g_hBeginPerChunkRenderDeferredSemaphore[iInstance]; g_iPerChunkQueueOffset[iInstance] += sizeof(WorkQueueEntrySetup); assert( g_iPerChunkQueueOffset[iInstance] < g_iSceneQueueSizeInBytes ); WorkQueueEntrySetup* pEntry = (WorkQueueEntrySetup*) &WorkerQueue[iQueueOffset]; pEntry->m_iType = WORK_QUEUE_ENTRY_TYPE_SETUP; pEntry->m_pSceneParamsStatic = pStaticParams; // shallow copy, mmm pEntry->m_SceneParamsDynamic = *pDynamicParams; // deep copy, gulp ReleaseSemaphore( hSemaphore, 1, NULL ); } } else if ( IsRenderDeferredPerChunk() ) { for ( int iInstance = 0; iInstance < g_iNumPerChunkRenderThreads; ++iInstance ) { ID3D11DeviceContext* pd3dDeferredContext = g_pd3dPerChunkDeferredContext[iInstance]; RenderSceneSetup( pd3dDeferredContext, pStaticParams, pDynamicParams ) ; } } else { RenderSceneSetup( pd3dContext, pStaticParams, pDynamicParams ) ; } //Render / Eventually will call RenderMesh g_Mesh11.Render( pd3dContext, 0, 1 ); // If we are doing ST_DEFERRED_PER_CHUNK or MT_DEFERRED_PER_CHUNK, generate and execute command lists now. if ( IsRenderDeferredPerChunk() ) { if ( IsRenderMultithreadedPerChunk() ) { // Signal all worker threads to finalize their command lists for ( int iInstance = 0; iInstance < g_iNumPerChunkRenderThreads; ++iInstance ) { // Create and submit a worker queue entry ChunkQueue& WorkerQueue = g_ChunkQueue[iInstance]; int iQueueOffset = g_iPerChunkQueueOffset[iInstance]; HANDLE hSemaphore = g_hBeginPerChunkRenderDeferredSemaphore[iInstance]; g_iPerChunkQueueOffset[iInstance] += sizeof(WorkQueueEntryFinalize); assert( g_iPerChunkQueueOffset[iInstance] < g_iSceneQueueSizeInBytes ); WorkQueueEntryFinalize* pEntry = (WorkQueueEntryFinalize*) &WorkerQueue[iQueueOffset]; pEntry->m_iType = WORK_QUEUE_ENTRY_TYPE_FINALIZE; ReleaseSemaphore( hSemaphore, 1, NULL ); } // Wait until all worker threads signal that their command lists are finalized WaitForMultipleObjects( g_iNumPerChunkRenderThreads, g_hEndPerChunkRenderDeferredEvent, TRUE, INFINITE ); } else { // Directly finalize all command lists for ( int iInstance = 0; iInstance < g_iNumPerChunkRenderThreads; ++iInstance ) { g_pd3dPerChunkDeferredContext[iInstance]->FinishCommandList( !g_bClearStateUponFinishCommandList, &g_pd3dPerChunkCommandList[iInstance] ) ; } } // Execute all command lists. Note these now produce a scattered render order. for ( int iInstance = 0; iInstance < g_iNumPerChunkRenderThreads; ++iInstance ) { pd3dContext->ExecuteCommandList( g_pd3dPerChunkCommandList[iInstance], !g_bClearStateUponExecuteCommandList ); SAFE_RELEASE( g_pd3dPerChunkCommandList[iInstance] ); } } else { // If we rendered directly, optionally clear state for consistent behavior with // the other render pathways. if ( g_bClearStateUponFinishCommandList || g_bClearStateUponExecuteCommandList ) { pd3dContext->ClearState(); } } return hr; } // 3 // Called Back by MultiDeviceContextDXUTMesh // //-------------------------------------------------------------------------------------- // The RenderMesh version which may redirect to another device context and/or thread. // This function gets called from the main thread or a per-scene thread, but not from // a per-chunk worker thread. // // There are three cases to consider: // // 1) If we are not using per-chunk deferred contexts, the call gets routed straight // back to DXUT with the given device context. // 2) If we are using singlethreaded per-chunk deferred contexts, the call gets added // to the next deferred context, and the draw submission occurs inline here. // 3) If we are using multithreaded per-chunk deferred contexts, the call gets recorded // in the next per-chunk work queue, and the corresponding semaphore gets incremented. // The appropriate worker thread detects the semaphore signal, grabs the work queue // entry, and submits the draw call from its deferred context. // // We ignore most of the arguments to this function, because they are constant for this // sample. //-------------------------------------------------------------------------------------- void RenderMesh( CMultiDeviceContextDXUTMesh* pMesh, UINT iMesh, bool bAdjacent, ID3D11DeviceContext* pd3dDeviceContext, UINT iDiffuseSlot, UINT iNormalSlot, UINT iSpecularSlot ) { static int iNextAvailableChunkQueue = 0; // next per-chunk deferred context to assign to if ( IsRenderMultithreadedPerChunk() ) { // Create and submit a worker queue entry ChunkQueue& WorkerQueue = g_ChunkQueue[iNextAvailableChunkQueue]; int iQueueOffset = g_iPerChunkQueueOffset[iNextAvailableChunkQueue]; HANDLE hSemaphore = g_hBeginPerChunkRenderDeferredSemaphore[iNextAvailableChunkQueue]; g_iPerChunkQueueOffset[iNextAvailableChunkQueue] += sizeof(WorkQueueEntryChunk); assert( g_iPerChunkQueueOffset[iNextAvailableChunkQueue] < g_iSceneQueueSizeInBytes ); WorkQueueEntryChunk* pEntry = (WorkQueueEntryChunk*) &WorkerQueue[iQueueOffset]; pEntry->m_iType = WORK_QUEUE_ENTRY_TYPE_CHUNK; pEntry->m_iMesh = iMesh; ReleaseSemaphore( hSemaphore, 1, NULL ); } else if ( IsRenderDeferredPerChunk() ) { // Replace the incoming device context by a deferred context ID3D11DeviceContext* pd3dDeferredContext = g_pd3dPerChunkDeferredContext[iNextAvailableChunkQueue]; RenderMeshDirect( pd3dDeferredContext, iMesh ); } else { // Draw as normal RenderMeshDirect( pd3dDeviceContext, iMesh ); } iNextAvailableChunkQueue = ++iNextAvailableChunkQueue % g_iNumPerChunkRenderThreads; } // Called by either Per Chunk Renderer // Or by Per Scene Renderer / mainthread in some convoluted way // threads -> RenderScene -> gMesh11.Render -> RenderMesh -> RenderMeshDirect -> gMesh11.RenderMesh // 4 //-------------------------------------------------------------------------------------- // The RenderMesh version which always calls the regular DXUT pathway. // Here we set up the per-object constant buffers. //-------------------------------------------------------------------------------------- void RenderMeshDirect( ID3D11DeviceContext* pd3dContext, UINT iMesh ) { HRESULT hr = S_OK; D3D11_MAPPED_SUBRESOURCE MappedResource; // Set the VS per-object constant data // This should eventually differ per object D3DXMATRIX mWorld; D3DXMatrixIdentity(&mWorld); // should actually vary per-object pd3dContext->Map( g_pcbVSPerObject, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ); CB_VS_PER_OBJECT* pVSPerObject = ( CB_VS_PER_OBJECT* )MappedResource.pData; D3DXMatrixTranspose( &pVSPerObject->m_mWorld, &mWorld ); pd3dContext->Unmap( g_pcbVSPerObject, 0 ); pd3dContext->VSSetConstantBuffers( g_iCBVSPerObjectBind, 1, &g_pcbVSPerObject ); // Set the PS per-object constant data // This should eventually differ per object pd3dContext->Map( g_pcbPSPerObject, 0, D3D11_MAP_WRITE_DISCARD, 0, &MappedResource ); CB_PS_PER_OBJECT* pPSPerObject = ( CB_PS_PER_OBJECT* )MappedResource.pData; pPSPerObject->m_vObjectColor = D3DXVECTOR4( 1, 1, 1, 1 ); pd3dContext->Unmap( g_pcbPSPerObject, 0 ); pd3dContext->PSSetConstantBuffers( g_iCBPSPerObjectBind, 1, &g_pcbPSPerObject ); g_Mesh11.RenderMesh( iMesh, false, pd3dContext, 0, 1, INVALID_SAMPLER_SLOT ); } void D3D11_Renderer::Present() { m_swapChain->Present(2,0); }
  11. When I create a multithreaded renderer for DX11 applications, do I create a separate device context for each individual thread? If I had 4 threads, each thread would have its own device context. If Yes, how do I create more than 1 device context using D3D11CreateDeviceAndSwapChain? Thanks Jack
  12. Hi everyone, I've randomly found this place trough google and this is my first post, I don't know if my beginner level is still too low even for the beginners sections therefore if it is, my first question would be to point me in the right place where I should ask my questions And if is ok, then this is my next question: I'm going trough the book "3d Game Programming with DirectX 11" and in the process of creating a swapChain I'm staring at this code below IDXGIDevice* dxgiDevice = 0; HR(md3dDevice->QueryInterface(__uuidof(IDXGIDevice), (void**)&dxgiDevice)); IDXGIAdapter* dxgiAdapter = 0; HR(dxgiDevice->GetParent(__uuidof(IDXGIAdapter), (void**))&dxgiAdapter)); IDXGIFactory* dxgiFactory = 0; HR(dxgiAdapter->GetParent(__uuidof(IDXGIFactory), (void**))&dxgiFactory)); IDXGISwapChain* mSwapChain; HR(dxgiFactory->CreateSwapChain(md3dDevice, )&sd, )&mSwapChain)); From my understanding, in order to create a swapChain we need to use the same Factory used to create our Device otherwise for some reason everything explodes, therefore the call to QueryInterface() and the two calls to GetParent() are meant to give me back a pointer to said Factory. Question 1): Now I'm watching msdn and a IDXGIDevice has a GetAdapter() method in it, so I was wondering, using it would achieve the same as the line "dxgiDevice->GetParent(__uuidof(IDXGIAdapter),(void**))&dxgiAdapter));" or is a completely different thing?! Question2): Not much further in the book, the writer do this "mSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), reinterpret_cast<void**>(&backBuffer));" so now we're using a reinterpret_cast and not "(void**)". Why this change? I am not very familiar with the different types of cast, so I can't tell the difference or the reason behind it x_x Also can you recomend me let's say a youtube video or some reading that properly illustrates the structure of Direct3D? Because I am kind of confuse about what is going on here, the whole hierarchy of this thing and basically I don't have a clear picture of how all the pieces fit togeter... Thanks
  13. Hi, I want to render a object with a dynamic vertex buffer and I do rendering in UI thread. I am thinking is it possible to change this vertex buffer content in a non UI thread using Map and Unmap. Thanks. YL
  14. What I see is a corner flower blue background in a window, I can't see a triangle at all. Thanks D3D11_Test.zip Jack
  15. I got stuck to draw a triangle using an index and DrawIndexed(), the triangle is not drawn. The windows just renders the blue background. While looking at other tutorials I think I did everything necessary to use an index, but maybe I am missing something?! Edit: Solved (thx Unbird), the array data type did not match the format in SetIndexBuffer, changing it back to int to match the format did the trick. I updated the code below for the next one using indices for SharpDX 1) Index array and buffer at the class variables // Vertices private VertexPositionColor[] vertices = new VertexPositionColor[] { new VertexPositionColor(new Vector3(-0.5f, 0.5f, 0.0f), SharpDX.Color.Red), new VertexPositionColor(new Vector3(0.5f, 0.5f, 0.0f), SharpDX.Color.Green), new VertexPositionColor(new Vector3(-0.5f, -0.5f, 0.0f), SharpDX.Color.Blue), }; // Indices private uint[] indices = new uint[] { 0, 1, 2 }; // Vertice-Buffer / Index-Buffer private D3D11.Buffer vertexBuffer; private D3D11.Buffer indexBuffer; 2) Set the indexbuffer private void InitializeTriangle() { vertexBuffer = D3D11.Buffer.Create(d3dDevice, D3D11.BindFlags.VertexBuffer, vertices); indexBuffer = D3D11.Buffer.Create(d3dDevice, D3D11.BindFlags.IndexBuffer, indices); } 3) Draw-Method: /// <summary> /// Draw the scene. /// </summary> private void Draw() { //Re-Initialize triangle InitializeTriangle(); // Set back buffer as current render target view d3dDeviceContext.OutputMerger.SetRenderTargets(renderTargetView); // Clear the screen d3dDeviceContext.ClearRenderTargetView(renderTargetView, new SharpDX.Color(32, 103, 178)); // Draw the triangle on the screen d3dDeviceContext.InputAssembler.PrimitiveTopology = PrimitiveTopology.TriangleList; d3dDeviceContext.InputAssembler.SetVertexBuffers(0, new D3D11.VertexBufferBinding(vertexBuffer, Utilities.SizeOf<VertexPositionColor>(), 0)); d3dDeviceContext.InputAssembler.SetIndexBuffer(indexBuffer, Format.R32_UInt, 0); d3dDeviceContext.DrawIndexed(3, 0, 0); // Swap front and back buffer swapChain.Present(1, PresentFlags.None); } . SharpDX_Tutorial_5_(using_an_index).zip
  16. this code is from introduction to DX11 by Frank D Luna. I kind of understand the theory of this. first get frustum coordinates in view space. get model's world matrix and view matrix. get inverse matrix to find out frustum's coordinates in model's local. my question is, why do I only need X component of scale matrix? what if the object got stretched by z,y axis? for(UINT i = 0; i < mInstancedData.size(); ++i) { XMMATRIX W = XMLoadFloat4x4(&mInstancedData.World); XMMATRIX invWorld = XMMatrixInverse(&XMMatrixDeterminant(W), W); // View space to the object's local space. XMMATRIX toLocal = XMMatrixMultiply(invView, invWorld); // Decompose the matrix into its individual parts. XMVECTOR scale; XMVECTOR rotQuat; XMVECTOR translation; XMMatrixDecompose(&scale, &rotQuat, &translation, toLocal); // Transform the camera frustum from view space to the object's local space. XNA::Frustum localspaceFrustum; //TransformFrustum(&localspaceFrustum, &mCamFrustum, XMVectorGetX(scale), rotQuat, translation); XNA::TransformFrustum(&localspaceFrustum, &mCamFrustum, XMVectorGetX(scale), rotQuat, translation); // Perform the box/frustum intersection test in local space. if(XNA::IntersectAxisAlignedBoxFrustum(&mSkullBox, &localspaceFrustum) != 0) { // Write the instance data to dynamic VB of the visible objects. dataView[mVisibleObjectCount++] = mInstancedData; } } md3dImmediateContext->Unmap(mInstancedBuffer, 0); }
  17. Hi, I want to use a 3D mouse to draw free-form line in 3D space using DirectX11. I have a question about how to create vertex buffer. Please see comments in the following code. struct SimpleVertexCombined { XMFLOAT3 Pos; XMFLOAT3 Col; }; D3D11_BUFFER_DESC bufferDesc; bufferDesc.Usage = D3D11_USAGE_DYNAMIC; bufferDesc.ByteWidth = ???;//the size will change dynamically, how to fill this part? bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; bufferDesc.CPUAccessFlags = 1; bufferDesc.MiscFlags = 0; After I create a dynamic vertex buffer, I use Map and UnMap to update the buffer. How to incrementally update the buffer? Any comments about how to do free-form line drawing in 3D space are really appreciated. Many thanks. YL
  18. Hi, I'm developing a mod for Dirt 3, I'm using 3DMigoto as a shader injector. I've modified 100s of shaders, but I'm completely stuck at implementing Screen Space reflections for water shaders. I've got it almost working, but the reflection is floating whenever I change the camera elevation and there is a lot of misaligned elements floating around. It's been my number one headache trigger for the last year. I've tried everything. but no luck so far. If there is anyone that could spare some time, take a look at the shader code and point me in the right direction I would be really grateful. Here is a video showing my problem: and the vertex and pixel shaders: // water deep not moving VS cbuffer _Globals : register(b0) { float HDRRange : packoffset(c29); float4x4 model : packoffset(c30); float4x4 modelViewProj : packoffset(c34); float2 AmbientLightMapScale : packoffset(c38); float4x4 modelView : packoffset(c39); float4x4 prevViewProj : packoffset(c43); float4x4 prevModel : packoffset(c47); float4 normalParams1 : packoffset(c51); float4 normalParams2 : packoffset(c52); float4 normalParams3 : packoffset(c53); float4 normalParams4 : packoffset(c54); float timer : packoffset(c55); float blendValue : packoffset(c55.y); float4 specularParams : packoffset(c56); float4 waveParams : packoffset(c57); float4 interactiveParams2 : packoffset(c58); float4 interactiveParams3 : packoffset(c59); float4 interactiveParams4 : packoffset(c60); } cbuffer CameraParamsConstantBuffer : register(b3) { float4x4 projection : packoffset(c0); float4x4 viewProjection : packoffset(c4); row_major float3x4 view : packoffset(c8); row_major float3x4 viewI : packoffset(c11); float3 eyePositionWS : packoffset(c14); float4x4 inverseProj : packoffset(c15); bool leftEye : packoffset(c19); bool padding3[3] : packoffset(c20); } cbuffer PerFrameConstantBuffer : register(b1) { float4 colorBufferEncodingParams : packoffset(c0); float4 envMapEncodingParams : packoffset(c1); float4 velocityEncodingParams : packoffset(c2); float4 snowEffectsParam2 : packoffset(c3); float4 sunDirectionAndTime : packoffset(c4); float4 sunColour : packoffset(c5); float4 skylightColour : packoffset(c6); float4 ambientOcclusionScales : packoffset(c7); float4 backlightColour : packoffset(c8); float4 specularScales : packoffset(c9); float3 specularDirection : packoffset(c10); float4 specularColourAndMultiplier : packoffset(c11); float4 fogColour : packoffset(c12); float4 fogParams : packoffset(c13); float4 hazeParams : packoffset(c14); float4 hazeParams2 : packoffset(c15); float4 nightLightmapParam1 : packoffset(c16); float4 nightLightmapParam2 : packoffset(c17); float4 wetLightingParam : packoffset(c18); float4 snowEffectsParam : packoffset(c19); float4 ambientColour : packoffset(c20); float4 shadowBlend : packoffset(c21); float4 maskParams : packoffset(c22); float4 deferredSpecularParams : packoffset(c23); } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : POSITION0, float3 v1 : NORMAL0, float3 v2 : TANGENT0, float3 v3 : BINORMAL0, float4 v4 : COLOR0, out float4 o0 : SV_Position0, out float4 o1 : COLOR1, out float4 o2 : TEXCOORD0, out float4 o3 : TEXCOORD1, out float4 o4 : TEXCOORD2, out float4 o5 : TEXCOORD3, out float4 o6 : TEXCOORD4, out float4 o7 : TEXCOORD5, out float4 o8 : TEXCOORD6, out float4 o9 : TEXCOORD7, out float4 o10 : TEXCOORD8, //viewPosition out float3 o11 : TEXCOORD9, //viewNormal out float3 o12 : TEXCOORD10) //csPos { float4 r0,r1,r2,r3,r4,r5; uint4 bitmask, uiDest; float4 fDest; //-- original game shader code r0.xyzw = modelViewProj._m01_m11_m21_m31 * v0.yyyy; r0.xyzw = modelViewProj._m00_m10_m20_m30 * v0.xxxx + r0.xyzw; r0.xyzw = modelViewProj._m02_m12_m22_m32 * v0.zzzz + r0.xyzw; r0.xyzw = modelViewProj._m03_m13_m23_m33 * v0.wwww + r0.xyzw; o0.xyzw = r0.xyzw; r1.xyz = model._m01_m11_m21 * v0.yyy; r1.xyz = model._m00_m10_m20 * v0.xxx + r1.xyz; r1.xyz = model._m02_m12_m22 * v0.zzz + r1.xyz; r1.xyz = model._m03_m13_m23 * v0.www + r1.xyz; r2.xyz = -eyePositionWS.xyz + r1.xyz; r1.w = dot(r2.xyz, r2.xyz); r1.w = sqrt(r1.w); r2.xyz = r2.xyz / r1.www; r2.x = saturate(dot(r2.xyz, sunDirectionAndTime.xyz)); r2.x = log2(r2.x); r2.x = hazeParams2.w * r2.x; r2.x = exp2(r2.x); r2.yzw = hazeParams2.xyz + -hazeParams.xyz; r2.xyz = r2.xxx * r2.yzw + hazeParams.xyz; r3.x = 1 / fogParams.z; r3.x = -r3.x + r1.w; r1.w = -30 + r1.w; r1.w = saturate(fogParams.z * r1.w); r4.w = fogParams.w * r1.w; r1.w = max(0, r3.x); r1.w = hazeParams.w * r1.w; r1.w = 1.44269502 * r1.w; r1.w = exp2(r1.w); r2.w = 1 + -r1.w; r4.xyz = fogColour.xyz; r3.xyzw = -r4.xyzw + r2.xyzw; r2.xyzw = r2.wwww * r3.xyzw + r4.xyzw; o1.xyz = r2.xyz * r2.www; o1.w = 1 + -r2.w; r2.xyz = model._m01_m11_m21 * v1.yyy; r2.xyz = model._m00_m10_m20 * v1.xxx + r2.xyz; r2.xyz = model._m02_m12_m22 * v1.zzz + r2.xyz; r1.w = dot(r2.xyz, r2.xyz); r1.w = rsqrt(r1.w); r2.xyz = r2.xyz * r1.www; o2.xyz = r2.xyz; r3.xy = interactiveParams2.wz * float2(1,-1); r3.xy = interactiveParams4.xx * r3.xy; r1.w = timer + 0.5; r3.xy = r1.ww * r3.xy; r3.zw = float2(0.0500000007,0.0500000007) * r1.xz; r3.xy = r3.zw * interactiveParams4.xx + r3.xy; o2.w = r3.x; o3.w = r3.y; r4.xyz = model._m01_m11_m21 * v2.yyy; r4.xyz = model._m00_m10_m20 * v2.xxx + r4.xyz; r4.xyz = model._m02_m12_m22 * v2.zzz + r4.xyz; r1.w = dot(r4.xyz, r4.xyz); r1.w = rsqrt(r1.w); r4.xyz = r4.xyz * r1.www; o3.xyz = r4.xyz; r5.xyz = r4.yzx * r2.zxy; r2.xyz = r2.yzx * r4.zxy + -r5.xyz; r1.w = dot(r2.xyz, r2.xyz); r1.w = rsqrt(r1.w); o4.xyz = r2.xyz * r1.www; o4.w = 0; r2.xyzw = normalParams4.xyzw + r1.xzxz; o7.xyz = r1.xyz; o7.w = 0; r1.xyzw = normalParams2.xxyy * r2.xyzw; r1.xyzw = specularParams.wwww * r1.xyzw; o5.xyzw = float4(0.0500000007,0.0500000007,0.0500000007,0.0500000007) * r1.xyzw; r1.xy = specularParams.ww * r3.zw; r1.zw = waveParams.xy * timer; r1.zw = normalParams1.zz * r1.zw; o6.xy = r1.xy * normalParams2.zz + r1.zw; r1.xy = interactiveParams3.ww * interactiveParams2.zw; r1.xy = timer * r1.xy; o6.zw = r3.zw * interactiveParams3.ww + r1.xy; o8.x = dot(float2(0.5,0.5), r0.xw); o8.y = dot(float2(0.5,0.5), r0.yw); o8.zw = r0.zw; r0.x = modelView._m21 * v0.y; r0.x = modelView._m20 * v0.x + r0.x; r0.x = modelView._m22 * v0.z + r0.x; o9.z = modelView._m23 + r0.x; o9.xyw = float3(0,0,1); //-- output values for SSR o10 = mul(modelView, v0.xyzw); //viewPosition o11 = mul((float3x3)modelView, v1.xyz); //viewNormal float4 position = mul(modelViewProj, float4(v0.xyzw)); o12 = position.xyz / position.w; //csPosition return; } // water deep not moving PS cbuffer _Globals : register(b0) { float HDRRange : packoffset(c29); float2 AmbientLightMapScale : packoffset(c29.y); float4 normalParams1 : packoffset(c30); float4 normalParams2 : packoffset(c31); float4 normalParams3 : packoffset(c32); float4 normalParams4 : packoffset(c33); float timer : packoffset(c34); float4 screenProj : packoffset(c35); float4 fresnelParams : packoffset(c36); float4 horizonColour : packoffset(c37); float4 nadirColour : packoffset(c38); float4 interactiveParams1 : packoffset(c39); float4 interactiveParams5 : packoffset(c40); float4 waterShadowBlend : packoffset(c41); float4 decodeParam : packoffset(c42); float4 sparkleParams : packoffset(c43); float4 sparkleParams2 : packoffset(c44); float blendValue : packoffset(c45); float4 specularParams : packoffset(c46); float4 waveParams : packoffset(c47); float4 interactiveParams2 : packoffset(c48); float4 interactiveParams3 : packoffset(c49); float4 interactiveParams4 : packoffset(c50); } cbuffer RenderTargetConstantBuffer : register(b2) { float4 viewportDimensions : packoffset(c0); } cbuffer CameraParamsConstantBuffer : register(b3) { float4x4 projection : packoffset(c0); float4x4 viewProjection : packoffset(c4); row_major float3x4 view : packoffset(c8); row_major float3x4 viewI : packoffset(c11); float3 eyePositionWS : packoffset(c14); float4x4 inverseProj : packoffset(c15); bool leftEye : packoffset(c19); bool padding3[3] : packoffset(c20); } cbuffer PerFrameConstantBuffer : register(b1) { float4 colorBufferEncodingParams : packoffset(c0); float4 envMapEncodingParams : packoffset(c1); float4 velocityEncodingParams : packoffset(c2); float4 snowEffectsParam2 : packoffset(c3); float4 sunDirectionAndTime : packoffset(c4); float4 sunColour : packoffset(c5); float4 skylightColour : packoffset(c6); float4 ambientOcclusionScales : packoffset(c7); float4 backlightColour : packoffset(c8); float4 specularScales : packoffset(c9); float3 specularDirection : packoffset(c10); float4 specularColourAndMultiplier : packoffset(c11); float4 fogColour : packoffset(c12); float4 fogParams : packoffset(c13); float4 hazeParams : packoffset(c14); float4 hazeParams2 : packoffset(c15); float4 nightLightmapParam1 : packoffset(c16); float4 nightLightmapParam2 : packoffset(c17); float4 wetLightingParam : packoffset(c18); float4 snowEffectsParam : packoffset(c19); float4 ambientColour : packoffset(c20); float4 shadowBlend : packoffset(c21); float4 maskParams : packoffset(c22); float4 deferredSpecularParams : packoffset(c23); } SamplerState TNormalMap_s : register(s0); SamplerState DepthMap_s : register(s1); SamplerState ReflectionMap_s : register(s2); SamplerState ReflectionMap2_s : register(s3); SamplerState TMaskMap_s : register(s4); SamplerState TShadowMask_s : register(s10); Texture2D<float4> DepthMap : register(t0); Texture2D<float4> TNormalMap : register(t1); Texture2D<float4> ReflectionMap : register(t2); Texture2D<float4> ReflectionMap2 : register(t3); Texture2D<float4> TShadowMask : register(t4); Texture2D<float4> TMaskMap : register(t5); //-- SSR buffers Texture2D<float> DepthBuffer : register(t100); SamplerState DepthBuffer_s : register(s11); Texture2D<float4> HDRTex : register(t101); SamplerState HDRTex_s : register(s12); //-- 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); //-- SSR Constants static float2 cb_depthBufferSize; // dimensions of the z-buffer static const float cb_zThickness = 1; // thickness to ascribe to each pixel in the depth buffer //static const float cb_nearPlaneZ = 0.6; // the camera's near z plane static const float cb_stride = 1; // Step in horizontal or vertical pixels between samples. This is a float // because integer math is slow on GPUs, but should be set to an integer >= 1. static float cb_maxSteps; // Maximum number of iterations. Higher gives better images but may be slow. //static const float cb_maxDistance = 10000; // Maximum camera-space distance to trace before returning a miss. static const float cb_strideZCutoff = 0; // More distant pixels are smaller in screen space. This value tells at what point to // start relaxing the stride to give higher quality reflections for objects far from // the camera. static const float cb_numMips = 1; // the number of mip levels in the convolved color buffer static const float cb_fadeStart = 0; // determines where to start screen edge fading of effect static const float cb_fadeEnd = 0; // determines where to end screen edge fading of effect static const float cb_sslr_padding0 = 0; // padding for alignment //--SSR Functions float linearizeDepth(float depth) { float4 tmp = mul(inverseProj, float4(0, 0, depth, 1)); return mul(projection, tmp / tmp.w).w; //float n = cb_nearPlaneZ; // camera z near //float f = cb_maxDistance; // camera z far //float z = depth; //return (2.0 * n) / (f + n - z * (f - n)); } float distanceSquared(float2 a, float2 b) { a -= b; return dot(a, a); } bool intersectsDepthBuffer(float z, float minZ, float maxZ) { /* * Based on how far away from the camera the depth is, * adding a bit of extra thickness can help improve some * artifacts. Driving this value up too high can cause * artifacts of its own. */ float depthScale = min(1.0f, z * cb_strideZCutoff); z += cb_zThickness + lerp(0.0f, 2.0f, depthScale); return (maxZ >= z) && (minZ - cb_zThickness <= z); } void swap(inout float a, inout float b) { float t = a; a = b; b = t; } float linearDepthTexelFetch(int2 hitPixel) { // Load returns 0 for any value accessed out of bounds return linearizeDepth(DepthBuffer.Load(int3(hitPixel, 0)).r); } bool traceScreenSpaceRay( // Camera-space ray origin, which must be within the view volume float3 csOrig, // Unit length camera-space ray direction float3 csDir, // Number between 0 and 1 for how far to bump the ray in stride units // to conceal banding artifacts. Not needed if stride == 1. float jitter, // Pixel coordinates of the first intersection with the scene out float2 hitPixel, // Camera space location of the ray hit out float3 hitPoint) { float near = linearizeDepth(0); float far = linearizeDepth(1); // Clip to the near plane float rayLength = ((csOrig.z + csDir.z * far) > -near) ? (-near - csOrig.z) / csDir.z : far; float3 csEndPoint = csOrig + csDir * rayLength; // Project into homogeneous clip space float4 H0 = mul(projection, float4(csOrig, 1.0f)); float4 H1 = mul(projection, float4(csEndPoint, 1.0f)); float k0 = 1.0f / H0.w; float k1 = 1.0f / H1.w; // The interpolated homogeneous version of the camera-space points float3 Q0 = csOrig * k0; float3 Q1 = csEndPoint * k1; // Screen-space endpoints float2 P0 = H0.xy * k0; float2 P1 = H1.xy * k1; // Scale to pixels: P0 = (P0 * float2(0.5, -0.5) + 0.5) * cb_depthBufferSize; P1 = (P1 * float2(0.5, -0.5) + 0.5) * cb_depthBufferSize; // If the line is degenerate, make it cover at least one pixel // to avoid handling zero-pixel extent as a special case later P1 += (distanceSquared(P0, P1) < 0.0001f) ? float2(0.01f, 0.01f) : 0.0f; float2 delta = P1 - P0; // Permute so that the primary iteration is in x to collapse // all quadrant-specific DDA cases later bool permute = false; if(abs(delta.x) < abs(delta.y)) { // This is a more-vertical line permute = true; delta = delta.yx; P0 = P0.yx; P1 = P1.yx; } float stepDir = sign(delta.x); float invdx = stepDir / delta.x; // Track the derivatives of Q and k float3 dQ = (Q1 - Q0) * invdx; float dk = (k1 - k0) * invdx; float2 dP = float2(stepDir, delta.y * invdx); // Scale derivatives by the desired pixel stride and then // offset the starting values by the jitter fraction float strideScale = 1.0f - min(1.0f, csOrig.z * cb_strideZCutoff); float stride = 1.0f + strideScale * cb_stride; dP *= stride; dQ *= stride; dk *= stride; P0 += dP * jitter; Q0 += dQ * jitter; k0 += dk * jitter; // Slide P from P0 to P1, (now-homogeneous) Q from Q0 to Q1, k from k0 to k1 float4 PQk = float4(P0, Q0.z, k0); float4 dPQk = float4(dP, dQ.z, dk); float3 Q = Q0; float end = P1.x * stepDir; float stepCount = 0.0f; float prevZMaxEstimate = csOrig.z; float rayZMin = prevZMaxEstimate; float rayZMax = prevZMaxEstimate; float sceneZMax = rayZMax + 100.0f; for(; ((PQk.x * stepDir) <= end) && (stepCount < cb_maxSteps) && !intersectsDepthBuffer(sceneZMax, rayZMin, rayZMax) && (sceneZMax != 0.0f); ++stepCount) { rayZMin = prevZMaxEstimate; rayZMax = (dPQk.z * 0.5f + PQk.z) / (dPQk.w * 0.5f + PQk.w); prevZMaxEstimate = rayZMax; if(rayZMin > rayZMax) { swap(rayZMin, rayZMax); } hitPixel = permute ? PQk.yx : PQk.xy; // You may need hitPixel.y = depthBufferSize.y - hitPixel.y; here if your vertical axis // is different than ours in screen space sceneZMax = linearDepthTexelFetch(int2(hitPixel)); PQk += dPQk; } // Advance Q based on the number of steps Q.xy += dQ.xy * stepCount; hitPoint = Q * (1.0f / PQk.w); return intersectsDepthBuffer(sceneZMax, rayZMin, rayZMax); } //-- Main stripped from all code, only planar reflection is displayed void main( float4 v0 : SV_Position0, float4 v1 : COLOR1, float4 v2 : TEXCOORD0, float4 v3 : TEXCOORD1, float4 v4 : TEXCOORD2, linear centroid float4 v5 : TEXCOORD3, linear centroid float4 v6 : TEXCOORD4, linear centroid float4 v7 : TEXCOORD5, float4 v8 : TEXCOORD6, linear centroid float4 v9 : TEXCOORD7, out float4 o0 : SV_Target0, float4 viewPosition : TEXCOORD8, float3 normalVS : TEXCOORD9, float3 csPosition : TEXCOORD10) { float4 stereo = StereoParams.Load(0); float separation = stereo.x * (leftEye ? -1 : 1); float convergence = stereo.y; viewPosition.x += separation * convergence * inverseProj._m00; DepthBuffer.GetDimensions(cb_depthBufferSize.x, cb_depthBufferSize.y); cb_maxSteps = cb_depthBufferSize.y; float2 hitPixel = float2(0.0f, 0.0f); float3 hitPoint = float3(0.0f, 0.0f, 0.0f); int3 loadIndices = int3(v0.xy, 0); float depth = DepthBuffer.Load(loadIndices); float3 rayOriginVS = viewPosition * linearizeDepth(depth); float3 toPositionVS = normalize(rayOriginVS); float3 rayDirectionVS = normalize(reflect(-toPositionVS, normalVS)); // output rDotV to the alpha channel for use in determining how much to fade the ray float rDotV = dot(rayDirectionVS, toPositionVS); float jitter = cb_stride > 1.0f ? float(int(v0.x + v0.y) & 1) * 0.5f : 0.0f; bool intersection = traceScreenSpaceRay(-rayOriginVS, -rayDirectionVS, jitter, hitPixel, hitPoint); if (intersection != false) o0.xyz = HDRTex.Load(float3(hitPixel, 0)); else o0.xyz = float3(0,0,0); o0.w=1; return; }
  19. Hi,   I want to sample the depth buffer in a screen space effect in a shader that draws a full screen quad, using the back buffer and depth buffer as input. Basically I want to adjust the alpha for every pixel based on its distance from the camera, so nearby objects get almost masked out while far away objects have alphas closer to 1.0. I create my depth-stencil buffer and view like this: D3D11_TEXTURE2D_DESC depthStencilDesc; depthStencilDesc.Width = mRenderWindow->getClientAreaWidth(); depthStencilDesc.Height = mRenderWindow->getClientAreaHeight(); depthStencilDesc.MipLevels = 1; depthStencilDesc.ArraySize = 1; depthStencilDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; depthStencilDesc.SampleDesc.Count = 1; depthStencilDesc.SampleDesc.Quality = 0; depthStencilDesc.Usage = D3D11_USAGE_DEFAULT; depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; depthStencilDesc.CPUAccessFlags = 0; depthStencilDesc.MiscFlags = 0; VERIFY(mD3DDevice->CreateTexture2D(&depthStencilDesc, 0, &mDepthStencilBuffer)); VERIFY(mD3DDevice->CreateDepthStencilView(mDepthStencilBuffer, 0, &mDepthStencilView)); I have a few questions.   1. Since I don't need to write to the depth buffer as I read from it in a shader, do I need to make any changes to the creation code above, or is it enough for me to unbind the depth buffer before binding it as a shader resource view?   2. Can I bind the mDepthStencilView as a shader resource view directly? Up till this point I have not sampled the depth buffer directly, only let the API use it in the depth test, so I have never thought of using it as an explicit shader input until now.   3. Since the format is DXGI_FORMAT_D24_UNORM_S8_UINT, that means that there are 24bits for the depth, right? How do I turn those into the floating point depth value between 0 and 1 in the pixel shader? Is there a special sampler I need to create or do I sample the xyz values and somehow combine those into a single value using bitwise operations in the shader?   Thanks for the help!
  20. recently, i profile my game use the gpu query. i use the method from mjp's blog. everything is fine, except that the present() use too much time, 6-10ms. even my game is gpu bound, this is too much, i don't use vsync. why present() use so much time? Thanks.
  21. Hi all In my post-processing pixel shader (HLSL, SM5) I am facing heavy banding issues as to be seen in the attached image. It doesn't matter what type of effect I am implementing (fake volumetric light in this case), it always happens when I am applying some color blending, e.g. fading out. Could this be a precision issue (I'm working with float numbers), or where do I have to start looking? Any hints will be appreciated!
  22. Hello, I would like to generate mipmaps for a RGBA8 texture, however it only works for one face. Here my source: D3D11_TEXTURE2D_DESC desc = { 0 }; desc.Width = this->x; desc.Height = this->y; if(cil_props & CIL_CUBE_MAP) desc.ArraySize = 6; else desc.ArraySize = 1; if (this->props&TEXT_BASIC_FORMAT::CH_ALPHA) desc.Format = DXGI_FORMAT_R8_UNORM; else desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; desc.SampleDesc.Count = 1; desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; desc.MiscFlags = 0; if (cil_props & CIL_CUBE_MAP) { desc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE; } desc.MipLevels = 0; desc.MiscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS; HRESULT hr; hr = D3D11Device->CreateTexture2D(&desc, nullptr, Tex.GetAddressOf()); if (hr != S_OK) { this->id = -1; return; } D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc{}; srvDesc.Format = desc.Format; if (cil_props & CIL_CUBE_MAP) { srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE; srvDesc.Texture2D.MipLevels = -1; srvDesc.TextureCube.MipLevels = -1; } else { srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; srvDesc.Texture2D.MipLevels = -1; } D3D11Device->CreateShaderResourceView(Tex.Get(), &srvDesc, pSRVTex.GetAddressOf()); D3D11_SUBRESOURCE_DATA initData[6]; int bufferSize = this->size/6; if (cil_props & CIL_CUBE_MAP) { unsigned char *pHead = buffer; for (int i = 0; i < 6; i++) { initData[i].pSysMem = pHead; initData[i].SysMemPitch = sizeof(unsigned char) * this->x * 4; pHead += bufferSize; } }else { initData[0].pSysMem = buffer; initData[0].SysMemPitch = sizeof(unsigned char) * this->x * 4; } if (cil_props & CIL_CUBE_MAP) { for (int i = 0; i < 6; i++) { D3D11DeviceContext->UpdateSubresource(Tex.Get(), i, 0, initData[i].pSysMem, initData[i].SysMemPitch, size); //size is the size of the entire buffer } }else { D3D11DeviceContext->UpdateSubresource(Tex.Get(), 0, 0, buffer, initData[0].SysMemPitch, 0); } D3D11DeviceContext->GenerateMips(pSRVTex.Get()); This code assume RGBA (32 bpp) and no mipmaps in the buffer. This is how it looks without mipmaps: This is how it looks with the code above, only one face is updated but curiously, that face alone does have mipmaps: Can anyone help me, I can add mipmaps offline but this should work, I would like to handle were the buffer is a cubemap and doesn't have any mipmaps. I tried on Intel and Nvidia, so I guess is not a driver issue, but something I am doing wrong. Thanks!
  23. I was using DX9 long time. Before i could use depth/stencil buffer with render target that has smaller size without a problem. Now i get this error: D3D11 ERROR: ID3D11DeviceContext::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatable with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. The RenderTargetView at slot 0 has (w:640,h:360,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:1280,h:720,as:1), while the Resource is a Texture2D with (mc:1,mq:0). D3D11_RESOURCE_MISC_TEXTURECUBE factors into the Resource type, unless GetFeatureLevel() returns D3D_FEATURE_LEVEL_10_1 or greater. [ STATE_SETTING ERROR #388: OMSETRENDERTARGETS_INVALIDVIEW] I thought i could reuse same DS. Such a waste if i have to create DS for every RT that doesnt match in size.
  24. Hi, I found this video, which can create a hole on the real wall and through this hole you can see sky and mountain outside. https://hololens.reality.news/news/video-holelenz-adds-magic-windows-hololens-gives-portals-new-worlds-0176281/ Any idea about how to reach this kind of effect? My speculation is first scan the wall to get the wall surface mesh and then break this mesh with a hole to generate the margin of the hole and then render hole margin and skybox(sky or mountain). Any comments are really appreciated. Best, YL
  25. I am a newbie programmer trying to learn game programming. I have had minimal experience with python so i wanted to learn the basics of C++ because I've heard its the best for game programming. I then read a primer book and made a quite robust little object oriented text game (at least where text games are concerned for me.) After having no success in finding a way to learn 2d game programming with C++ I dived headfirst into learning C++ 3d game programming with books like "Introduction to 3D Game Programming With DirectX11" and "Game Coding Complete." I am having trouble taking grasp of the concepts put forth in the book like 3d and object oriented encapsulation for hierarchies for game objects and that kind of stuff. My question is what should I read or do to understand these things better that's comprehesible and easier to get into pertaining graphics and structure. I just want to make a simple game maybe pong or something not some crazy 3d matricy vertex rendering collision physics lighting mumbo jumbo, at least not at first. Should I look more into python pygame stuff or Unity? Or is there hope for beginners in C++?