# lucky6969b

Members

1561

1329 Excellent

• Rank
Contributor
1. ## The "Sky" is too short!

I wonder if I can map a flat texture to a 8-sided skybox, without the bottom
2. ## The "Sky" is too short!

How come I got a teared sky after writing this code? const D3DXMATRIX* v = m_pCam->GetViewMatrix(); const D3DXMATRIX* p = m_pCam->GetProjMatrix(); D3DXMATRIX vp = *v * *p; D3DXVECTOR3 camPos = m_pCam->GetPos(); D3DXVECTOR4 camPosVec4(camPos.x, camPos.y, camPos.z, 1); D3DXMATRIX matCam; //D3DXMatrixTranslation(&matCam, camPos.x, camPos.y, camPos.z); // camPosVec4 * vp; D3DXVECTOR4 targetVec4; D3DXVec4Transform(&targetVec4, &camPosVec4, &vp); D3DXVECTOR3 targetPos(targetVec4.x, targetVec4.y, targetVec4.z); //D3DXMATRIX target = matCam * vp; D3DXMATRIX target; D3DXMatrixTranslation(&target, targetPos.x, targetPos.y, targetPos.z); Update2: Now it works better now, but why the sky is below the line of ground (the horizon).... seems like if my camera pos is at a y position of 150, the sky is at 150 as well. which is pretty low. The skyplane size is calculated as follows: the variable f denotes the far clip plane distance which is 10000. Then the farHeight is about 8000 meters FLOAT farHeight = 2 * tan(fov/2) * f; FLOAT depth = 0.0f; FLOAT farWidth = farHeight * m_pCam->GetAspect();
3. ## The "Sky" is too short!

Get something to work today. But the problem is the sky disappears with a quick flash. Does that mean the sky actually lies beyond the far clip plane? const D3DXMATRIX* v = m_pCam->GetViewMatrix(); const D3DXMATRIX* p = m_pCam->GetProjMatrix(); D3DXMATRIX vp = *v * *p; D3DXVECTOR3 camPos = m_pCam->GetPos(); D3DXMATRIX matCam; D3DXMatrixTranslation(&matCam, camPos.x, camPos.y, camPos.z); D3DXMATRIX target = matCam * vp; // Do not light sky box. d3d::GetInstance().GetDevice()->SetRenderState(D3DRS_LIGHTING, false); // Don't write skybox to the depth buffer; in this way, // the skybox will never occlude goemtry, which it should not // since it is "infinitely" far away. d3d::GetInstance().GetDevice()->SetRenderState(D3DRS_ZWRITEENABLE, false); d3d::GetInstance().GetDevice()->SetRenderState(D3DRS_ZENABLE, false); // Set sampler states to clamp so that edge seam does not show where // two box faces coincide. d3d::GetInstance().GetDevice()->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); d3d::GetInstance().GetDevice()->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); d3d::GetInstance().GetDevice()->SetTransform(D3DTS_WORLD, &target); DrawMesh(m_SkyPlaneMesh);
4. ## The "Sky" is too short!

In other words, sky planes are more than enough. I just push them to the far clip plane at render stage? BTW, it's 1000 meters anyway
5. ## The "Sky" is too short!

What is the optimal radius of a skydome, I am currently giving it 1000 units, looks like the sky is too short.
6. ## Unreal workflow

I've watched a video on how the per-pixel lighting rendering is done with unreal. The video says 1) Build a high res version of the mesh 2) Build a low res version of the same mesh 3) Calculate the difference and create a normal map based on that 4) The normal map is used to texture the low res version of the mesh Are there any more detailed readings I can take about how this is done? Thanks Jack
7. ## How to animate the UV correctly?

Something to consider. 1) If I don't like generating the sky using POV/fractals artifically because of personal preferences. 2) If I move the uvs with the skydome, I just get a revolving sky. 3) If I omit part of the uvs, and showing them later, the texture on the skydome won't be continuous 4) Is it possible to patch the textures at runtime? 5) Is it very resource hungry for mapping avis to spherical mesh? Update: I've successfully mapped an avi to the skydome, but the resolution allowed is ridiculously low... like 384x180 (or 384x240) but my avi is out of aspect ratio Thanks Jack
8. ## How to animate the UV correctly?

How about using a damn longish texture... then map 0,0 -> 0.1,0 for left plane, 0.1,0 -> 0.2,0 for front, 0.2,0 -> 0.3,0 for right -> 0.3,0 -> 0.4,0 for back and swifting the UV then wrap to 0,0 again.... Thanks Jack
9. ## What engines do you use, and why

I personally don't use any game engines because I like to have full control/flexibility on what I can do to the game. Although you can still do the same things with a game engine, when you are programming at the lowest-level, you really feel a lot of freedom on what you are doing, especially AI stuff.
10. ## How to animate the UV correctly?

https://blenderartists.org/forum/showthread.php?24038-Free-high-res-skymaps-(Massive-07-update!) If I take one of those, I can make an animated sky only for one of the planes of the skybox, Can I map a single texture to top, left, right, front and back planes all at once, BTW, if I take the one above, that is spherical maps, I only get static skydomes, Is it possible to simulate the day-and-night effect with a single spherical map? Thanks Jack
11. ## How to animate the UV correctly?

How to animate the UV of textured vertexes so that the texture seems like sweeping across horizontally and slowly? The target are general skies, If I want to have day-and-night effect, do I download a seamlessly perfect day-and-night sky texture? which the ends touch and wrap around the other?
12. ## DX11 Migrating from DX9 to DX11: Assimp and fixed pipelines Problems

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
13. ## DX11 Slight Modifications to the Multithreaded Renderer in the DX11 SDK?

Oh... My Bad, I was presenting the scene using a DX9 device.... Sorry, it works now, thanks