I'm attempting to translate some C++ DX11 Direct3d height-map code into Delphi. I'm at at a stage where I have almost the entire code translated across without any compile errors or run-time errors however I cannot for the life of me get anything to render on-screen - which I believe may be a vertex/pixel shader issue.
The code I'm translating across is here:
http://www.rastertek.com/tertut02.html
And I'm using the JSB DirectX11 interface libraries from here:
http://www.jsbmedical.co.uk/DirectXForDelphi/
I know that the Direct3D subsystem is working correctly as I am able to alter the color of the background of the render surface however, I just do not get any polygons rendered on the display.
There is quite a lot of code which I'm unable to upload here so for convenience, here's a copy of my source (without any object files/binaries)
https://www.dropbox.com/s/r90jbl6vz9gb3s7/Delphi%20Height%20Map.zip?dl=0
Unfortunately, there doesn't appear to be many Delphi DX11 or D3D examples on the internet so I have nothing to benchmark the code against.
I'd be eternally grateful if anyone could offer any pointers as to what may be the issue. Like I say, the code compiles and runs without any errors but just nothing is rendered.
Thanks in advance,
Kevin
You can look here on how to do basic rendering with D3D11 using Delphi - https://github.com/AntonAngeloff/DX11_Examples
These examples use another headers translations, though.
Related
The SharpDX toolkit has been abandoned for 3.0 SharpDX :(
Unfortunately, we need/are using this for a current Windows 10 project.
What we need to do is create a Sphere object as a surface so we can project on to it. Can anybody lead me to some things (or simply provide said things) that might help me out?
Thanks!
I can help you with the toolkit side of things, I'm using this atm for my terrain color map building I'm not sure how it will go if you use it every frame for UI type stuff because the guy that converted it to sharpdx 3 used pinvoke instead of the native fixed call.
https://github.com/tomba/Toolkit
just download as zip, load into VS and remove all the test\projects that fail to load then just build and add a ref to you project like normal.
I'm trying a long-time to find algorithm PSOLA (Pitch Synchronous Overlap Add) or WSOLA (Waveform Similarity Overlap Add) which are Acoustic or Signal Processing Algorithms.
I found it in c++, but I have no experience in c++ and is difficult to pass it to Pascal. Anyone have this code in Pascal or know where to find it to copy?
Something like this example that is in c++
http://sourceforge.net/projects/mffmtimescale/files/v3%20stable/v3.9/WSOLA.v.3.9.zip/download?use_mirror=ufpr
Try the SoundTouch DLL, it comes with a Delphi import unit, so you can use the DLL directly. It should not be too hard to compile it. Just download the free VC++ Express from the MS download site and compile it with that or ask someone with VC++ to compile it for you.
FWIW, who knows, with a few modifications, it might also compile with C++Builder.
About one decade ago, I've used praat in FSeqEdit (Delphi program) to do these type of calculations, but I think the same approach would still work fine today.
I wrote some praat-scripts and execute them via praatcons.exe (console version of praat). You can download the console version from this page:
http://www.fon.hum.uva.nl/praat/download_win.html
That works pretty good.
I usually take this approach:
I manually check what type of conversions and calculations need to be done via the GUI version of praat. Once I find what I need, I create a script for it, and run that with the console version.
Praat is very powerful, so if you didn't know about it yet, make sure to check it out.
There's a page that shows how to work with PSOLA resynthesis here:
http://www.ling.ohio-state.edu/~kyoon/praat-tut/praat-tut2.html
Let me know if you want to see some example code on how to integrate it into your Delphi application (it's pretty straightforward actually).
Is there any tool for testing pixel and vertex shaders?
nVidia FX Composer (There was also AMD (formerly ATI) RenderMonkey, but it looks like that's been shelved.)
Finally, you may find PIX useful for testing shaders as they are used in your application. It is included in the DirectX SDK.
For HLSL Effects that you can use in XNA (PS 2.0-3.0) you can try:
3DPee (Tridipy) player and shader editor (dead link)
It operates on images and video.
It supports multi pass technique, vertext shader, and has a nice editor with error message reporting on compile.
It's an alpha version i have developed but it can be useful.
Screenshot:
You need to have a Mac to use it, but Apple's OpenGL Shader Builder is pretty nice. You can literally type in shaders and run them live, outside of your application.
A nice one here for WebGL: http://glsl.heroku.com
I am currently working on a little graphics demo (using DirectX) which is primarily based around an HLSL shader I am working on. Using the D3DX10CreateEffectFromFile I am loading (and compiling the shader) at runtime as I find it easier for tweaking.
However, once I am done I'd like to do some combination of the following:
Pre-compile the shader so the demo starts up faster for the user
Bury (compile into the executable) the compiled shader (or maybe just the source if necessary)
Primarily, I want to do this because I want the demo to just be one file that can be very easily copied around.
One thing I could easily do is just put the source text right into a cpp but that would be very tedious I needed to update it later.
Is it possible to do something like this (using Visual Studio, DirectX, HLSL)?
As pointed out in that link you can simply add it as a binary resource to the exe.
Personally, though, I'd go with something like having a big binary file. The start of the file has a table of contents. Basically a shader ID and an offset. The offset then corresponds to where the binary compiled data starts. You can put 4 bytes at the top of each compiled shader that says how long it is as well. Inserting a new shader can get troublesome though as it does require moving a fair whack of data around but seeing as its an offline process its not really a problem.
If you have been successful in persisting your data, which type of stream did you get to work
Text or Binary
ANSI or UNICODE
Did you have to use any BOOST_ASSERTS or some extra MACRO or dance around the fairy ring at 4:00 am wearing your Moose sweater backwards.
Thanks for your answer
There is a posting for C++Builder 2010 (unfortunately I do not know of one for 2009), that shows the portions of the Boost (1.39) that are included in the shipping product. The serialization library is listed as not supported. Note the posting also includes a link to the source code they used in case someone wants to experiment with the unsupported libraries.
I haven't tried, so I can't directly answer. However, here are the boost 1.37.0 test results for C++Builder 2009 (the column on the right, "borland-6.1.0").
You can see most things in 'serialization' pass the tests. Some don't, so if you compare what you're trying to do to those it should help you to know what to avoid. The test suites may also useful to you, because they can be used as code examples for using the features they test.
You may find other resources on the C++ Builder Boost page to be useful too.