World faces disappearing with render.RenderView

I’ve having a problem with render.RenderView(): It doesn’t always render something that is in view.

Here is an example of me walking away from a wall. The view in the top left is from render.RenderView(), and you can see things start appearing as I walk backwards.

It starts with the lamp, and then continues on with the building faces.

http://img132.imageshack.us/img132/8616/rpcity8canals0054.jpg

The light appears:

http://img132.imageshack.us/img132/9519/rpcity8canals0055.jpg

Where is the face of the building on top? It’s just sky:

http://img132.imageshack.us/img132/7963/rpcity8canals0056.jpg

There is part of it:

http://img132.imageshack.us/img132/4241/rpcity8canals0057.jpg

Beige building on the right changed:

http://img132.imageshack.us/img132/9015/rpcity8canals0058.jpg

Now we see the whole picture.

http://img132.imageshack.us/img132/3181/rpcity8canals0059.jpg

Any ideas?

My guess would be doing something with SetupPlayerVisibility

Doesn’t that just determine which portions of the map the server sends updates to the client about?


This only happens on some maps in some situations, as it seems to work with most maps I try. However, shadows are also not always drawn right.

Example (there should be two trees with incorrectly drawn shadows):
http://www.sk89q.com/uploads/trees2.swf (click on the scene and drag)

It generally works well though:
http://www.sk89q.com/content/2010/02/rp_amsterville_1.swf
Although in the example, the edge between the skybox and the end of the water is not right completely.

Odd, my suspicion would be that the game is culling the faces erroneously due to the camera being somewhere other than the player’s eyes.

I had a similar issue before, where, after setting up drawing with cam.Start3D() sprites would draw the sprites orientated towards the player, rather than towards the camera I was rendering them from.

Perhaps the code that determines the visibility of the faces are using the player’s eyes instead of the camera position.
Does this bug ever occur on non-VIS optimized maps?

CAn it be that the camera is Inside the player? Did you try putting it outside a bit?

From my experience, render.RenderView doesn’t update the aspect ratio of the culling rectangle. Essentially, whatever you set the size to, anything that gets out of the screen resolution’s aspect ratio will get culled.

I could be wrong, but that’s what I’ve observed.

@theJ89: The camera is actually right at the player’s eyes.

Nevec’s idea sounds like it is the issue, but oddly enough, I did not experience this problem on my laptop, using resolutions of both aspect ratios 4:3 and 16:10:
http://sk89q.com/uploads/rp_city8_canals.swf
(Note: There is a problem with the light cones/glows, but presumably I cannot do anything about that. Or maybe…)

However, if that is indeed the issue, I am thinking about hooking CalcView and overriding the FOV to an insanely high amount.

That won’t fix the issue with images directly behind though, so I am thinking about doing Player:SetEyeAngles() repeatedly for every view. Is this a good idea? Bad idea? Does it even work if I do it all in one tick?

I’ve been unable to fix the problem. I have tried:
[ul]
[li]Putting the camera outside the player[/li][li]Using the CalcView hook to set a high FOV[/li][li]Rendering a view that has the same aspect ratio as the player’s normal view/game window[/li][/ul]
Any ideas? The odd thing is that I don’t experience this problem on my laptop.

If it doesn’t do it with your laptop its probably a driver problem. See if your video card drivers are out of date.