Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
d3042280
Commit
d3042280
authored
Nov 19, 2018
by
Juan Linietsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not draw particles if they are not processing at all, fixes #19507
parent
55ded6b2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
3 deletions
+27
-3
rasterizer_dummy.h
drivers/dummy/rasterizer_dummy.h
+2
-0
rasterizer_storage_gles2.cpp
drivers/gles2/rasterizer_storage_gles2.cpp
+4
-0
rasterizer_storage_gles2.h
drivers/gles2/rasterizer_storage_gles2.h
+2
-0
rasterizer_storage_gles3.cpp
drivers/gles3/rasterizer_storage_gles3.cpp
+7
-0
rasterizer_storage_gles3.h
drivers/gles3/rasterizer_storage_gles3.h
+2
-0
rasterizer.h
servers/visual/rasterizer.h
+2
-0
visual_server_scene.cpp
servers/visual/visual_server_scene.cpp
+8
-3
No files found.
drivers/dummy/rasterizer_dummy.h
View file @
d3042280
...
...
@@ -681,6 +681,8 @@ public:
int
particles_get_draw_passes
(
RID
p_particles
)
const
{
return
0
;
}
RID
particles_get_draw_pass_mesh
(
RID
p_particles
,
int
p_pass
)
const
{
return
RID
();
}
virtual
bool
particles_is_inactive
(
RID
p_particles
)
const
{
return
false
;
}
/* RENDER TARGET */
RID
render_target_create
()
{
return
RID
();
}
...
...
drivers/gles2/rasterizer_storage_gles2.cpp
View file @
d3042280
...
...
@@ -3842,6 +3842,10 @@ RID RasterizerStorageGLES2::particles_get_draw_pass_mesh(RID p_particles, int p_
void
RasterizerStorageGLES2
::
update_particles
()
{
}
bool
RasterizerStorageGLES2
::
particles_is_inactive
(
RID
p_particles
)
const
{
return
true
;
}
////////
void
RasterizerStorageGLES2
::
instance_add_skeleton
(
RID
p_skeleton
,
RasterizerScene
::
InstanceBase
*
p_instance
)
{
...
...
drivers/gles2/rasterizer_storage_gles2.h
View file @
d3042280
...
...
@@ -1090,6 +1090,8 @@ public:
virtual
int
particles_get_draw_passes
(
RID
p_particles
)
const
;
virtual
RID
particles_get_draw_pass_mesh
(
RID
p_particles
,
int
p_pass
)
const
;
virtual
bool
particles_is_inactive
(
RID
p_particles
)
const
;
/* INSTANCE */
virtual
void
instance_add_skeleton
(
RID
p_skeleton
,
RasterizerScene
::
InstanceBase
*
p_instance
);
...
...
drivers/gles3/rasterizer_storage_gles3.cpp
View file @
d3042280
...
...
@@ -6455,6 +6455,13 @@ void RasterizerStorageGLES3::update_particles() {
glDisable
(
GL_RASTERIZER_DISCARD
);
}
bool
RasterizerStorageGLES3
::
particles_is_inactive
(
RID
p_particles
)
const
{
const
Particles
*
particles
=
particles_owner
.
getornull
(
p_particles
);
ERR_FAIL_COND_V
(
!
particles
,
false
);
return
!
particles
->
emitting
&&
particles
->
inactive
;
}
////////
void
RasterizerStorageGLES3
::
instance_add_skeleton
(
RID
p_skeleton
,
RasterizerScene
::
InstanceBase
*
p_instance
)
{
...
...
drivers/gles3/rasterizer_storage_gles3.h
View file @
d3042280
...
...
@@ -1261,6 +1261,8 @@ public:
virtual
int
particles_get_draw_passes
(
RID
p_particles
)
const
;
virtual
RID
particles_get_draw_pass_mesh
(
RID
p_particles
,
int
p_pass
)
const
;
virtual
bool
particles_is_inactive
(
RID
p_particles
)
const
;
/* INSTANCE */
virtual
void
instance_add_skeleton
(
RID
p_skeleton
,
RasterizerScene
::
InstanceBase
*
p_instance
);
...
...
servers/visual/rasterizer.h
View file @
d3042280
...
...
@@ -518,6 +518,8 @@ public:
virtual
void
particles_set_fractional_delta
(
RID
p_particles
,
bool
p_enable
)
=
0
;
virtual
void
particles_restart
(
RID
p_particles
)
=
0
;
virtual
bool
particles_is_inactive
(
RID
p_particles
)
const
=
0
;
virtual
void
particles_set_draw_order
(
RID
p_particles
,
VS
::
ParticlesDrawOrder
p_order
)
=
0
;
virtual
void
particles_set_draw_passes
(
RID
p_particles
,
int
p_count
)
=
0
;
...
...
servers/visual/visual_server_scene.cpp
View file @
d3042280
...
...
@@ -1912,9 +1912,14 @@ void VisualServerScene::_prepare_scene(const Transform p_cam_transform, const Ca
if
(
ins
->
base_type
==
VS
::
INSTANCE_PARTICLES
)
{
//particles visible? process them
VSG
::
storage
->
particles_request_process
(
ins
->
base
);
//particles visible? request redraw
VisualServerRaster
::
redraw_request
();
if
(
VSG
::
storage
->
particles_is_inactive
(
ins
->
base
))
{
//but if nothing is going on, don't do it.
keep
=
false
;
}
else
{
VSG
::
storage
->
particles_request_process
(
ins
->
base
);
//particles visible? request redraw
VisualServerRaster
::
redraw_request
();
}
}
if
(
geom
->
lighting_dirty
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment