Skip to content

bevy_webgl2 render backend#613

Closed
mrk-its wants to merge 12 commits into
bevyengine:masterfrom
mrk-its:wasm
Closed

bevy_webgl2 render backend#613
mrk-its wants to merge 12 commits into
bevyengine:masterfrom
mrk-its:wasm

Conversation

@mrk-its

@mrk-its mrk-its commented Oct 2, 2020

Copy link
Copy Markdown
Member

No description provided.

@cart

cart commented Oct 2, 2020

Copy link
Copy Markdown
Member

Wow you've been busy 😄

@memoryruins memoryruins added C-Feature A new feature, making something new possible O-Web Specific to web (WASM) builds A-Rendering Drawing game state to the screen labels Oct 2, 2020
Comment on lines +148 to +157
let mut layouts = {
let mut layouts = vec![vertex_spirv.reflect_layout(bevy_conventions).unwrap()];
log::info!("vertex shader layout: {:#?}", layouts[0]);
if let Some(ref fragment_spirv) = fragment_spirv {
layouts.push(fragment_spirv.reflect_layout(bevy_conventions).unwrap());
log::info!("fragment shader layout: {:#?}", layouts[1]);
};

layouts
};

This comment was marked as resolved.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just reverted all changes in this file

Comment on lines +34 to +58
pub fn fmt_as_output_edge(
&self,
f: &mut std::fmt::Formatter<'_>,
nodes: &HashMap<NodeId, NodeState>,
) -> std::fmt::Result {
match self {
Edge::SlotEdge { input_index, output_index, .. } => write!(f, " SlotEdge(in #{}, out #{}", input_index, output_index)?,
Edge::NodeEdge { .. } => write!(f, " NodeEdge(")?,
}
let node = nodes.get(&self.get_input_node()).unwrap();
write!(f, "{:?})", node)
}

pub fn fmt_as_input_edge(
&self,
f: &mut std::fmt::Formatter<'_>,
nodes: &HashMap<NodeId, NodeState>,
) -> std::fmt::Result {
match self {
Edge::SlotEdge { input_index, output_index, .. } => write!(f, " SlotEdge( in #{}, out #{}, ", input_index, output_index)?,
Edge::NodeEdge {..} => write!(f, " NodeEdge(")?,
}
let node = nodes.get(&self.get_output_node()).unwrap();
write!(f, "{:?})", node)
}

This comment was marked as resolved.

Comment on lines +293 to +298
writeln!(f, "");
write!(f, " out edges:");
for edge in &node.edges.output_edges {
edge.fmt_as_output_edge(f, &self.nodes);
};
writeln!(f, "");

This comment was marked as resolved.

Comment on lines +191 to +192
let cnt = visible_entities.iter().count();
log::info!("visible entities:{:?}", cnt);

This comment was marked as resolved.

@mrk-its mrk-its force-pushed the wasm branch 5 times, most recently from f9beb95 to 32b8ad9 Compare October 6, 2020 09:11
@chemicstry

chemicstry commented Oct 6, 2020

Copy link
Copy Markdown

Can this also function as a native OpenGL backend? Afaik, the only difference is wasm bindings.

Something like glow can be used to support many platforms at once

Amazing work btw 💯

@mrk-its

mrk-its commented Oct 6, 2020

Copy link
Copy Markdown
Member Author

Can this also function as a native OpenGL backend? Afaik, the only difference is wasm bindings.
Something like glow can be used to support many platforms at once

Definitely. I'm finishing cleanup of this PR (a lot of mess landed here while exploring how everything works), after that I'll try to explore glow. Thanks!

@mrk-its mrk-its force-pushed the wasm branch 5 times, most recently from 7e4f88b to 89c04ca Compare October 12, 2020 18:38
@mrk-its mrk-its force-pushed the wasm branch 7 times, most recently from cb3fc9a to 05bf8ae Compare October 19, 2020 16:47
@mrk-its mrk-its marked this pull request as draft October 22, 2020 00:25
@mrk-its mrk-its changed the title WIP - bevy_webgl2 render backend bevy_webgl2 render backend Oct 22, 2020
@zicklag

zicklag commented Oct 23, 2020

Copy link
Copy Markdown
Member

Hey, I just want to say how glad I am that somebody is working on this! Web and OpenGL support are something I would really like to see in Bevy! 😃

Also, I can vouch for glow being pretty cool and in my ( somewhat limited ) experience, it makes it very easy to handle GL On Whatever. 😁

@mrk-its mrk-its force-pushed the wasm branch 2 times, most recently from caf87d9 to bbdd412 Compare October 25, 2020 11:16
@memoryruins memoryruins mentioned this pull request Nov 8, 2020
@kirawi

kirawi commented Nov 9, 2020

Copy link
Copy Markdown

Ah, so cool!

@mrk-its

mrk-its commented Nov 16, 2020

Copy link
Copy Markdown
Member Author

Closing as bevy_webgl2 is now available as external plugin: https://github.com/mrk-its/bevy_webgl2

@mrk-its mrk-its closed this Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible O-Web Specific to web (WASM) builds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants