-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Improving design of materials, parameters... #92
Comments
@fabrobinet thanks for taking the time to write this up.
OK with me.
Although I proposed these names at one point to match WebGL calls, they are too inconsistent with other glTF names, I suggest going back to
This doesn't match the work we've done so far, but I suppose that is not important for this discussion. |
@pjcozzi : good feedback.!
Why does parameter in material need a type? Isn't the type known as part of the program? Why redefine it for all materials? We might have discussed this before, but why are attributes and uniforms grouped together? Isn't this harder for the client? GL treats them separately. |
Hi Fab Ready to get on the call. Can you point to the latest proposal for all On Thu, May 30, 2013 at 1:53 PM, Fabrice Robinet
Tony Parisi [email protected] Read my book! WebGL, Up and Running |
We are currently brainstorming, there will be a new proposal based on discussion |
Simplified material syntax: "material.2": { On Thu, May 30, 2013 at 2:03 PM, Fabrice Robinet
Tony Parisi [email protected] Read my book! WebGL, Up and Running |
ok. |
@pjcozzi about symbols... we can arrange in a more explicit way.
|
Should uniforms/attributes have types? On Thu, May 30, 2013 at 5:33 PM, Fabrice Robinet
|
I would say, due to the redesign above, the question should be "Should parameters have types".
|
@fabrobinet your separation of |
@fabrobinet any update here? |
@pjcozzi I have been thinking quite a lot about this... I'll try to write the update today. |
Starting by just summing up what was agreed so far we have in material (but not yet implemented),
and in techniques:
So, regarding parameters, we could stop there. Uniforms and attributes would be better encapsulated together with program.
This said, the
So, program in pass would be inconsistent with it. I propose to introduce useProgram here, it matches "glUseProgram" in GL APIs. it would give us.
or we can take the COLLADA approach and use the instance concept and have instead.
@tparisi @RemiArnaud @pjcozzi |
I like instanceProgram All of our instancing naming conventions should follow that e.g. Tony On Tue, Jun 4, 2013 at 3:01 PM, Fabrice Robinet [email protected]:
Tony Parisi [email protected] Read my book! WebGL, Up and Running |
Either is OK with me.
|
@RemiArnaud let's move on, ok with instanceProgram ? |
@RemiArnaud and I discussed this during our meeting. First of all, to be consistent with instanceProgram, as proposed & agreed in previous discussion, To illustrate this, we can update the material example discussed previously and use instanceTechnique:
As you may have noticed, this example contains other changes:
The previous proposal a few comments ago for technique does not change i.e (we go straight on the pass for the interesting part).
|
As a check-point, from here we agreed on:
The remaining design discussion about what we called so far |
@fabrobinet this is OK with me. |
implemented everything discussed in this thread : 230169c |
I think this works... looking forward to full examples to look over. Thanks for the hard work on this one. |
we're done here, spec should be updated. |
@fabrobinet schema is updated, can we close this? |
Because some bugs are too tied to be answered in detail separately,
I have created this umbrella bug to recap decision for the following bugs:
#82
#79
We will start by answering #82 so we see how parameters are specified and can be overrided at the material level.
That's the first step of this proposal, and it's in this current comment.
Then, in a following comment we'll describe #79 to propose override at the mesh level and also introduce meshInstance.
This proposal is not yet implemented but I plan to update the converter soon.
It should be recap of discussions especially recent ones with Remi.
Tony and Patrick, please let me know if anything needs to be clarified.
Currently we have for example, taking
material.2
below, we will override the parameterambient
To specify a parameter value, we currently have :
And in
techniques
, we have the techniques, that contains passes with program.Program contains attributes and uniforms.
Note: we should probably have a top property
programs
withprogram
inside, so that we can explicitly share them and not only via techniques.This is discussed/proposed later in this issue.
That worked ok far, but it has some issues:
This had the side effect of preventing the override attributes set (like UVs, as it is specified with semantic).
The reason was to make specific parameters for each techniques, but not doing so is not bad since it allows to share parameters when possible.
As shown below, by moving up the parameters in material, the path for animation becomes more apparent.
For instance in this example an animation would specify in its channel the following target to animate ambient in a material:
target: { "id" : "material.2" , "path" : "ambient" }.
Note 1: we thought about renamed "parameters" to "override" but it was before agreeing that parameters should appear explicitly in techniques (because parameters should be shared between passes).
Note 2: To prevent useless writing, parameters is excluded from the path, because for materials, a target is always a parameter.
So the above example becomes (simpler) now:
In programs now every attribute - even those associated with a semantic - have a parameter that may set a value.
At the technique level, you can set default values for parameters.
The proposal, is an intermediate step:
From the step above, we can simplify the pass object (parameters, stays unchanged) by :
The text was updated successfully, but these errors were encountered: