Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bevy_webgl2 render backend #613

Closed
wants to merge 12 commits into from
Closed

bevy_webgl2 render backend #613

wants to merge 12 commits into from

Conversation

mrk-its
Copy link
Member

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

No description provided.

@cart
Copy link
Member

cart commented Oct 2, 2020

Wow you've been busy 😄

@memoryruins memoryruins added C-Enhancement A new feature 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
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
Copy link

chemicstry commented Oct 6, 2020

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
Copy link
Member Author

mrk-its commented Oct 6, 2020

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 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
Copy link
Member

zicklag commented Oct 23, 2020

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. 😁

@memoryruins memoryruins mentioned this pull request Nov 8, 2020
@kirawi
Copy link

kirawi commented Nov 9, 2020

Ah, so cool!

@mrk-its
Copy link
Member Author

mrk-its commented Nov 16, 2020

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-Enhancement A new feature O-Web Specific to web (WASM) builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants