Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Render just visible parts ?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 andrei94   Members   -  Reputation: 134

Like
0Likes
Like

Posted 18 June 2012 - 01:34 PM

Hello everyone ! my name is Andrei and im kinda new to DirectX

Im trying to develop a simple 2D game and im just wondering ... if i have let's say a big map 1024x1024 that's not shown as whole ... let's say that on the screen appears just a 500x500 frame ...is directx rendering all the map with all things on it and show just a part or it's rendering just the shown by camera part ? if it's rendering the whole thing... how to make it render what i need.. how to optimize it ?;D


Ty in advance :D

Sponsor:

#2 pcmaster   Members   -  Reputation: 679

Like
0Likes
Like

Posted 19 June 2012 - 08:26 AM

By 1024x1024 you mean tiles, right? You didn't provide much info...

#3 andrei94   Members   -  Reputation: 134

Like
0Likes
Like

Posted 19 June 2012 - 11:02 AM

forget it i just wanted to say if i have a big map... that i don't see all ... it's rendered all or just visible parts ? ;D

#4 HNikolas   Members   -  Reputation: 192

Like
0Likes
Like

Posted 20 June 2012 - 06:26 AM

What you are talking about is clipping. DirectX has clipping enabled by default so if you don't disable it yourself, it does that.

http://en.wikipedia.org/wiki/Clipping_%28computer_graphics%29

Edited by HNikolas, 20 June 2012 - 06:27 AM.

Ruby on Rails, ASP.NET MVC, jQuery and everything else web.. now also trying my hand on games.

#5 clickalot   Members   -  Reputation: 173

Like
0Likes
Like

Posted 20 June 2012 - 07:14 AM

Clipping occurs in DirectX after the view transform.
So the World*View will still be computed for all the vertices in the scene, even if they will eventually be clipped.
In order to further optimize this you need some sort of spatial partitioning.
Since you have a 2D game here, a simple distance function from the camera could be used to reject objects from being rendered.
If you want you could use a grid for to split your scene into multiple areas and only render objects inside the viewable grid locations. This assumes that each grid cell is composed out of multiple objects.

#6 hdlopesrocha   Members   -  Reputation: 145

Like
-1Likes
Like

Posted 20 June 2012 - 06:38 PM

I think you need something like "frustum culling"...




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS