Game Development Community

Zoomed in LOD quality?

by Andy Gilbert · in Torque 3D Professional · 11/11/2012 (8:36 am) · 21 replies

Hi, im just desiging a large open(ish) level and was wondering what the process is to making zoomed view look..well good?

My scene is full of vegetation and grass ETC and looks great when close, but if i go up somehwere high and zoom in as if a sniper, theres no grass, no shadows ETC and anyone would stick out like a saw thumb...

How is this generally controlled?

Thanks
Andy
Page «Previous 1 2
#1
11/12/2012 (9:54 am)
that's all controlled in each object's render distance settings. Since you don't actually move closer the ground cover doesn't render (you're not actually close enough to make it render). Perhaps you can fiddle with the player's position or create a dummy object at the target location and set it as control when zoomed so the system will think you are actually there.... Wow, terrible hack that. Maybe you can increase the render distance when zoom is on, too - might be a better hack.
#2
11/12/2012 (10:06 am)
Hi Richard, thanks for the reply, does the render distance also apply for ground cover as thats how the grass is spread throughout the scene, also what about shadows?

There needs to be a way of rendering high quality only whats in view.

Thanks
Andy
#3
11/12/2012 (12:36 pm)
As far as I remember, in TGE, LOD was controlled by an object's size on screen. So as you zoomed in, objects would appear larger and render with the appropriate LOD. Is that no longer the case? Seems like that would be a sensible system to re-implement!
#4
11/12/2012 (12:44 pm)
Yes I believe that is the case for objects. But not for ground cover. I guess this is because ground cover is already at it's lowest lod (billboard) so the last step is to make it disappear. Which is the dissolve radius, you can set this to the radius cover but that basically means you need to cover your whole world in order for it to be seen shen zoomed, which isn't efficient at all.

What I think should happen is the radius works as it should so ground cover appears around you as you walk around your scene but should also somehow take into consideration the pixel size. Then when zoomed the ground cover will appear.

Andy
#5
11/12/2012 (12:48 pm)
Right, sorry about that - I just re-read your post and realised you were talking about ground cover.

EDIT: This code in GroundCover::prepRenderImage may be worth checking out:
// Set the far distance for billboards.
      mCuller.setFarDist( mRadius );   

      F32 cullScale = 1.0f;
      if ( state->isReflectPass() )
         cullScale = mReflectRadiusScale;
These lines seem to decide on the distance for cells to be culled, as well as the scale used to fade billboards out.
#6
11/12/2012 (3:01 pm)
I fiddled a bit with the function I mentioned. Try making the changes from this commit, see if that alleviates the issue a bit.
#7
11/12/2012 (9:54 pm)
Let me know if this method works for you.
It might steer me in the right direction for implementing a "real" sniper scope.
"Real" as in, weather, temperature, wind, distance, ballistics, etc. That I have been designing on paper.

Since I will need to have the target I am aiming at, to appear somewhat clearly and include the trees and ground cover that surround the target.
Obstructions along the path of the bullet would interfere with the trajectory. So this thread becomes important to me.

I was thinking of possibly adding a second cam to the player. The new cam would become the control object that was offset by the amount of zoom I use for the scope.
#8
11/12/2012 (10:49 pm)
This sounds great. I'll be able to check of the above method works in the next hour or so.

Thanks
Andy.
#9
11/13/2012 (1:17 am)
Hi, sorry for the delay. Im still getting my head around torque.So for me to make the changes i need to then re-compile the engine is that right?Do i do this for the particular project or make this change in the torque engine folder?If i do it for my particular project, how as i cant find a sln or anything to open?ThanksAndy
#10
11/13/2012 (2:29 am)
Yes you need to alter the source and recompile, the file is in:-

(wherever you installed Torque)/Engine/source/T3D/fx/groundCover.cpp
edit this file with 'Visual Studio' then recompile (If you have installed DX9 SDK etc. it should compile without errors (Ignore the warnings))

The sln is in (wherever you installed Torque)/My Projects/(your game name)/buildFiles/VisualStudio 2010/(your game name).sln
(that is assuming your using Visual Studio 2010)

Hope this helps :-)
#11
11/13/2012 (2:43 am)
So if i change the file (wherever you installed Torque)/Engine/source/T3D/fx/groundCover.cpp and created a NEW project, would that work or do i actually need to recompile the whole engine after the change in order for it to take effect?

If so, is there a tut on how this is done, i do see a vsproj for the whole engine?

Sorry for the aggro.

Thanks
Andy
#12
11/13/2012 (4:44 am)
Hi Andy. You can get a step-by-Step guide to compiling the engine from the Home page here at GG. The top blue bar "Documentation" link will guide you to it but here is the direct link:
docs.garagegames.com/torque-3d/official/index.html?content/documentation/Setup/O...
Just begin with setup and read through from there to find the section you need.
#13
11/13/2012 (6:20 am)
Ok, unfortunatly im not havnig much luck at compiling this, so maybe you more experienced guys could try it? Im getting errors, I noticed one of them was:

d:torque3d-masterenginesourcet3dfxgroundcover.cpp(1555): error C2065: 'screenScale' : undeclared identifier Which i belive directly relates to the change.

Then despite having the PhysX SDK installed (not the current one but the one the docs tell you to download) i get these:

17>d:torque3d-masterenginesourcet3dphysicsphysxpx.h(54): fatal error C1083: Cannot open include file: 'NxPhysics.h': No such file or directorySorry to not be much help.Any advise would be great.

Thanks
Andy
#14
11/13/2012 (2:04 pm)
That first error sounds like you didn't add the line beginning with `F32 screenScale` or made a typo in the variable name. Not sure what to do about the PhysX error, I've never used PhysX!

As far as I can tell, the changes work for me, I was just wondering whether they help you in your specific situation.

Quote:would that work or do i actually need to recompile the whole engine after the change in order for it to take effect?
Each individual project has its own VS solution, which you need to compile each time you change the engine. All projects share the same engine files (in Engine/source).
#15
11/13/2012 (2:14 pm)
One way you could approach this is rather then the way the zoom currently approaches, start fresh, and make the zoom move the camera closer, that, in theory, should draw everything in view as if you were there... shouldn't it ?

Disclaimer, im not a coder, i make eyecandy...
#16
11/13/2012 (2:57 pm)
That'd be like those old games that used to pull off spotlights by just creating a point light some distance away from you. The effect is close, but the shadows are all wrong - they come from the point lamp, rather than your character. The same would apply to zooms.

Problem is, your FOV is wrong. When you zoom in using FOV changes, you'll notice that things look flatter. You move closer to an orthogonal perspective, where parallel lines actually appear parallel, instead of converging on a vanishing point. When you zoom by moving the camera towards the subject ('dollying'), you actually change the angle at which you perceive objects. It's how filmmakers achieve the vertigo effect, or a 'dolly zoom'.
#17
11/13/2012 (3:42 pm)
Quote:Not sure what to do about the PhysX error, I've never used PhysX!

I dont understand how you build the solutions without physX, when i add a new project using the project manager, i choose full physX, it then copies all files over and then attempts to copy source, but says "cannot find physX SDK...ETC" so no build files get copied with the new project, if you try to "generate build files" it says the same error?

The in the buildfiles folders, there isnt any solutions.

Thanks
Andy
#18
11/13/2012 (3:53 pm)
Did you also download the PhysX software with the SDK from the same page?

My installation works for compiling and the files for PhysX are in the project folder. ( put there when i generate a new Full PhysX project).

I also tried the compiling of the engine changes and it compiles without error. I still hadn't tested it with a Zoom yet since I don't have any billboards or my sniper scope written.
#19
11/13/2012 (3:56 pm)
Ahh, sounds like the PhysX SDK isn't registered in your project, this may have been caused by installing the PhysX SDK before installing VS 2010, try reinstalling the PhysX SDK
#20
11/14/2012 (2:42 am)
Hi, ok, so i dont know how or what ive managed to do, but i got it to compile and the changes work perfect! :)

When you zoom (stock zoom with right mouse button) billboards appear nicley!

Now to try and get my head around what was happenenig with compiling.

I feel i need to have a good knowledge strnegth in re-compiling as im sure ill come up against this again.

NOTE: ok, whilst im at it, the reason this compiled was because i used the "full" template and not the "full physX" template, therefore physX wasnt included as its that which is causing the errors.

Does anybody know why this would be?

Thanks
Andy
Page «Previous 1 2