(using smart pointers where appropriate) is insufficient?
Is it too slow to populate, to iterate over, to search through?
tred that , was way too slow .
had to re configure my engine to use enums : got the speed now though
enums aren't any smaller or easier to hash than pointers. If you're not using pointers and are copying your entire object every time... yeah, that's going to suck.
But since you won't actually tell us anything meaningful... best of luck with that.
erm , need to sort my entitys so that i have less state changes on the GPU , so need to bucket sort all my enttiys via the shader pointer , so when done i have one bucket for all entitys that have shader plaincolour, other plainTexture , other phong , other normalmapping ect
and did an analize and it was saying with map, it was saying the slowest thing in my engine was itterating through the map , once i collected all my info into the buckets
would someone mind explaining a little on how Assimp handles textures. I've started working on a model loader and can currently load models. I'm using a simple color shader right now until I can figure out textures to display the model. I can get the uv coords for the textures and add them to my vertex structure.. but that's about all I understand how to do as far as how assimp handles textures.
You need to create the associated Texture2D resource as a Texture2D array resource, and then create a shader resource view for that resource. If you're using D3DX helper functions the easiest thing to do is this:
1. Load all of the textures using D3DX10CreateTextureFromFile, with a D3DX10_IMAGE_LOAD_INFO specifying that you want D3D10_USAGE_STAGING. Note that all of your textures need to be the same size, have the same format, and have the same number of mip levels 2. Map every mip level of every texture 3. Set up an array of D3D10_SUBRESOURCE_DATA's with number of elements == number of textures * number of mip levels. 4. For each texture, set the pSysMem member of a D3D10_SUBRESOURCE_DATA to the pointer you got when you mapped each mip level of each texture. Make sure you also set the SysMemPitch to the pitch you got when you mapped that mip level 5. Call CreateTexture2D with the desired array size, and pass the array of D3D10_SUBRESOURCE_DATA's 6. Create a shader resource view for the texture
all my files are loaded in as ID3D10ShaderResourceView
is there no way to make is use this to create another ID3D10ShaderResourceView which is an array?
Good evening to all at GameDev im very much a noob to C++ and i am looking for some advice to my issue below is the source to a small program where i get the user to enter there name and then there name is displayed back to them on the screen all this works 100% fine but the main issue is that the console window closes and opens very fast below is the source code
std::cout << "Please enter your first name:";
std::cin >> FirstName;
std::cout << FirstName << "\n";
you need to move to proper HLSL now , not the old methid
I've got a load of source compiled and running with the from source engine I'm learning. Quite a big step for me all those static libraries, dynamincally linked libraries, a tonne of SIMD stuff that had to be commented out because it was in the wrong assembly format for my compiler (Intel whereas CB uses AT&T), pixel shader, vertex shaders etc....
Sure I've come a long way. Shoot I even know how most of it works. I printed off a load of paper copies of the source and I often nip out to local pubs for a coffee whilst having a read!
But I have hit a couple of snags in concept stuff. Mainly about what's really going on between the CPU, the RAM and the GPU and the RAM on the graphics card (not sure of proper terminology for this). That's for another thread though, this one is about shaders and lighting.
I've got the shaders to run and work. Have a look at their code, pretty simple as far as I know in shader talk:
The vsh does some stuff with the geometry and then moves the value stored in the constant register c4 into the output register oD0 which is then inputted into the psh. Whenever a function that affects the light is used it gets the value relating to light colour and intensity and loads it into the register c4. SetAmbientLight does this, for example.
mul r0, v0, t0
Here the value in v0 (which I assume is the received light data from the vsh) is multiplied with the texel and the final result stored in the psh output register r0. Ok fine.
BUT (you knew it was coming).....
The scene is blacker than the underside of a witch's boob on a moonless night. If I change the code for the psh to this:
add r0, v0, t0
... then all affected geometry becomes so bright you could hunt rabbits with them on a dark winter's evening.
So, obviously something odd is happening here. The original author's shaders produces scenes that are way too dark. Yet my own alterations produce scenes that are horribly bright, and cause very bad colour mixing between the ambient light and the texel colour. Like if for example I set ambient to 0.5f,0.5f,0.5f middle of teh road grey, then instead of the predominatly green appearance of the demo model (a green tank) showing through more strongly, it just has this awful painted grey appearance to it, rather like someone has just thrown a load of grey paint over it.
What is the proper method here? I just want to be able to nicely mimic with a shader what i've already achieved fine with the fixed function pipeline in the past. But I don't know the proper algorithm for lighting. The one I've made is bright but awful, the one the author made is horribly dark, even with ambient light set to max (1.0f,1.0f,1.0f).
I'd also rather not discuss point and directional lights just yet, although I have got these working well, but again I had to depart from the author's code as it was too dark. Furthermore the extra passes per light make things difficult so if possible I'd rather just talk about getting good ambient light working for now, thanks.
I'd appreciate any replies anyone can take the time to write. Seems to me good lighting it what makes a huge difference to the pleasure the eye feels when playing a game or looking at any rendered scene for that matter.