Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12045 Posts in 1593 Topics- by 593 Members - Latest Member: zhang

19. June 2013, 08:19:27 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)what do I need to do when discarding a shader program
Pages: [1]
Print
Author Topic: what do I need to do when discarding a shader program  (Read 598 times)
hawkwind
Getting respectable
***
Offline Offline

Posts: 365



View Profile Email
« on: 02. December 2008, 06:59:44 pm »

In some cases I have shaders running on shapes that I remove from the scene graph when n longer needed.  Do I need to manually stop/remove then shader??
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #1 on: 02. December 2008, 07:16:42 pm »

In some cases I have shaders running on shapes that I remove from the scene graph when n longer needed.  Do I need to manually stop/remove then shader??

No, you don't have to do anything.

Are you just asking to make sure? Or do you actually have a problem?

Marvin
Logged
hawkwind
Getting respectable
***
Offline Offline

Posts: 365



View Profile Email
« Reply #2 on: 02. December 2008, 07:54:28 pm »

no problems, my game is in "chapters",  a unique scene graph for each chapter.  It occurred to me I knew how to start a shader but did not know how to end one and free up any resources involved.  I was worried i was leaving a increasing pile of shaders running in the background.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4403


May the 4th, be with you...


View Profile
« Reply #3 on: 02. December 2008, 08:09:52 pm »

no problems, my game is in "chapters",  a unique scene graph for each chapter.  It occurred to me I knew how to start a shader but did not know how to end one and free up any resources involved.  I was worried i was leaving a increasing pile of shaders running in the background.

No a shader is not running, if an "owning" shape is not attached to the scenegraph while rendering. You don't even need anything to do to "start" a shader program. You just attach it to a shape and it is used while rendering this shape. Hence there is nothing, you need to do to "stop" it. And all resources are cleaned up with garbage collection.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic