Re: RenderColorTarget bug?

From: Robert Dunlop [MS MVP] (rdunlop_at_mvps.org)
Date: 11/07/04


Date: Sun, 7 Nov 2004 01:04:11 -0800


"edenxiii" <edenxiii@discussions.microsoft.com> wrote in message
news:85B007AC-FB99-418A-83FB-E535E836D45C@microsoft.com...
> Thanks for replying! I realized that after a few hours, but adding the
> semantic didn't change anything. I was told on another forum that scripts
> defined in a semantic need to be executed by the host application. This is
> confusing, because the SDK implies ( though it doesn't explicitly state )
> that this "industry-standard scripting syntax" would be executed by D3D
> without me having to parse the semantic myself in the application. Is this
> true? Are these scripts left for the host application to parse and
> execute?

I wondered after I posted if maybe there was a misunderstanding here - yes,
you have to implement these in your application for them to have any effect.
Object semantics (unlike symantics assigned to shader functions) and
notations in HLSL don't have any significance to the effect's execution,
rather they are there for your
application to query and act upon.

Thus if you wish to use the standard semantics and notations, your
application will need to implement them, or at least the subset that you
wish to implement. Of course you could use your own semantics and
notations, though using the defined "standard" may hopefully result in the
long run to compatability available tools honoring the same definitions.

In the case of object semantics and notations, one thing you'll need to do
is scan the effect for objects that need initialized. Take a look at the
CRenderView::ParseParameters function in the RenderView.cpp file of the
effect edit sample, this demonstrates a search for parameters to be
initialized and maps various parameters to application handles (such as
transformation matrices). It deals with notations for texture creation
(like image file to load to texture, dimensions of texture, etc), though it
doesn't deal with semantics like RenderColorTarget - you would need to add a
check for such semantics and reflect this in the texture creation.

Also, I notice that in the 9.0 October update there are files
CDXUTEffectMap.cpp and CDXUTEffectMap.h in the \samples\c++\common directory
that may be of interest to you, I haven't checked them out in depth but they
appear to be functions for parsing and mapping the standard notations from
an effect file, might be worth a look.

As with the other standard semantics and annotations, the scripting
annotations would likewise need to be implemented by your application.
These are intended as a way to drive an existing script engine from an
effect file. If you don't already have such in your application, and are
only looking to use these to adjust states, you'll need to put something
together that interprets and implements the script commands you wish to
execute.

-- 
Robert Dunlop
The X-Zone
http://www.directxzone.org/
Microsoft DirectX MVP
-------------
The opinions expressed in this message are my own personal views and do not
reflect the official views of the Microsoft Corporation.
The MVP program does not constitute employment or contractual obligation
with Microsoft.


Relevant Pages

  • Re: Query regarding Semantic Analyzer
    ... notations commonly used to define the semantics of a programming ... Attribute grammars, Two level Grammar, Denotational Semantics, ... more natural for language designers, ...
    (comp.lang.fortran)
  • Query regarding Semantic Analyzer
    ... notations commonly used to define the semantics of a programming ... attribute grammars can be modified to handle dynamic semantics as well. ...
    (comp.lang.fortran)
  • Re: What language could be written "Matrix"
    ... Unfortunately the scripts of these movies were probably written in a language with no formally specified semantics. ... I wonder if the Lisp society has tried to address this shortcoming, or whether some statically typed language would be better suited for writing movie scripts. ... Well, the dialog within the scripts may or may not have formal semantics, depending on how much you believe in Chomsky's theories. ...
    (comp.lang.lisp)
  • Re: Cannot find/open fonts -- executing oolatex
    ... how to make them more robust? ... I will need some better understanding how those scripts are executed. ... completely alters the semantics of an equation. ... through mzlatex gives expected results. ...
    (comp.text.tex)